lkml.org 
[lkml]   [2017]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] Staging: media: omap4iss: Use WARN_ON() instead of BUG_ON().
On Fri, Sep 8, 2017 at 8:08 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Fri, Sep 08, 2017 at 07:38:18PM +0530, Srishti Sharma wrote:
>> Use WARN_ON() instead of BUG_ON() to avoid crashing the kernel.
>>
>> Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
>> ---
>> drivers/staging/media/omap4iss/iss.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c
>> index c26c99fd..b1036ba 100644
>> --- a/drivers/staging/media/omap4iss/iss.c
>> +++ b/drivers/staging/media/omap4iss/iss.c
>> @@ -893,7 +893,7 @@ void omap4iss_put(struct iss_device *iss)
>> return;
>>
>> mutex_lock(&iss->iss_mutex);
>> - BUG_ON(iss->ref_count == 0);
>> + WARN_ON(iss->ref_count == 0);
>
> ref_counting bugs often have a security aspect. BUG_ON() is probably
> safer here. Better to crash than to lose all your bitcoin.

Okay, Thanks for this.

Regards,
Srishti

>
> regards,
> dan carpenter
>

\
 
 \ /
  Last update: 2017-09-08 17:00    [W:0.078 / U:3.800 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site