[PATCH v3 01/12] s3c-fb: Fix various null references on framebuffer memory alloc failure

Pawel Osciak p.osciak at samsung.com
Fri Jul 2 08:56:06 EDT 2010


>Ben Dooks <ben at simtec.co.uk> wrote:
>On 28/06/10 09:08, Pawel Osciak wrote:
>> @@ -819,7 +820,8 @@ static void s3c_fb_release_win(struct s3c_fb *sfb,
>struct s3c_fb_win *win)
>>  {
>>  	if (win->fbinfo) {
>>  		unregister_framebuffer(win->fbinfo);
>> -		fb_dealloc_cmap(&win->fbinfo->cmap);
>> +		if (&win->fbinfo->cmap)
>> +			fb_dealloc_cmap(&win->fbinfo->cmap);
>
>did you really mean &win->fbinfo->cmap? surely that will end up
>always evaluating to true?
>

It should have actually been:

+		if (win->fbinfo->cmap.len)
+			fb_dealloc_cmap(&win->fbinfo->cmap);

Thanks, will post a fix for this patch.


Best regards
--
Pawel Osciak
Linux Platform Group
Samsung Poland R&D Center





More information about the linux-arm-kernel mailing list