lkml.org 
[lkml]   [2013]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH V3] drm_crtc: check if fb_create return NULL
Date
On Thu, 24 Jan 2013, "Su, Xuemin" <xuemin.su@intel.com> wrote:
> On Thu, 2013-01-24 at 10:31 +0200, Jani Nikula wrote:
>> > }
>> > + /* some buggy driver may return NULL here, which may cause panic */
>> > + BUG_ON(!fb);
>>
>> I fail to see the benefit of this compared to just letting it oops...
>>
>> > or->fb_id = fb->base.id;
>>
>> ...right here.
>>
>>
> For PATCH V3, I think a BUG_ON may give the user clearer information
> about the reason of panic. Easier to debug.

Ah, sorry, never mind, I missed Daniel's comment. The benefit of the
BUG_ON() is making it clear what's expected of the drivers.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


\
 
 \ /
  Last update: 2013-01-24 10:44    [W:0.063 / U:2.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site