From: Geert U. <ge...@li...> - 2001-06-13 16:23:19
|
On Wed, 13 Jun 2001, James Simmons wrote: > > > int fb_set_var(struct fb_var_screeninfo *var, struct fb_info *info) > > > { > > > int oldbpp, err; > > > > > > if (memcmp(&info->var, var, sizeof(var))) { > > > if ((err = info->fbops->fb_check_var(var, info))) > > > return err; > > > > This is not correct, since it first overwrites the old var, then checks whether > > the new one is valid. If that test fails, you're left with an invalid var in > > info->var. > > That is a memory compare. It checks to see if the purposed mode is the > same as the current mode. If not then fb_check_var is called to test the > new var. info->var = var only if var->activate == FB_ACTIVATE_NOW and > their is a set_par function. You can set info->var = *var before set_par > is called because we trust check_var did its job. Sorry, my twisted mind read memcpy() instead of memcmp(). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |