From: James S. <jsi...@tr...> - 2001-06-13 16:15:25
|
> > 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. |