Received: by 10.223.185.116 with SMTP id b49csp7623019wrg; Thu, 1 Mar 2018 08:22:33 -0800 (PST) X-Google-Smtp-Source: AG47ELu3sU/7l5O+80VyO3/GddKI2eFonfH2G+UnkmDQTtxCmI4TIw4UhiSlFt6TspwETMdv/FB/ X-Received: by 10.98.31.79 with SMTP id f76mr2508627pff.60.1519921353832; Thu, 01 Mar 2018 08:22:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519921353; cv=none; d=google.com; s=arc-20160816; b=LIiYTrPtr9eaDtr/fkhbodhuhHUB9MxvWvzv1+Gt8Yrr1t2L3gYDqb4aWp+LJAS3qR q78biK4/c0hO0PekWBLUNztIGy+9w/QxHnp3JoHWmI12BRF61ix5Er+1D8CLhXmgfmHY kOtA44t8JABRTJxf+ADIWuOj0rXLc21mc2IhwQuCadiUF2mL3VdPF+5N/p2d4l0LvBng Lq/QbmZswUKgmWVk/yymMVooV4dgv1gFYLpld7+LjTUlHmbK4RqMwOZi1HRc+8//eGG/ dW/lPj85Lco/wqjHy1K78v+YSBUIqnN9G4c2w8vyAXYBD2OWJJ8vPqO+sk+yk0mSJWL0 4++w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=oQ5bMYRHB6f4dfr67AdAVn7vcDGKX+onNZvzwHYQC2M=; b=WuqTUyxiHJ0asqdkKVqXeRtWlARj2xaoIK+7kyLh6IoQ85E8jrFCZLXSDKLpUZamY1 RaWTc1Qtjq/jaWFqqI3dDfFZl5N8gHsInjyNEt3d1PeSFCcGSDxOThuSHC0sDehnQ0ig KjiW6F31eE9088T+ya8n+Snm0xgkGDdR7+NF53RR5zi13UvQF9M3yfVYICUn3zZ0O7kh rQrT3V6iaph27GOucxUB9b5FIv1RVesIpt0hcszmU1EiT6ZVGi1e6HMadyN2UWWH/x2U ux/BMs4NEvs/oMjOFwV7necVdoK9croRb8F4OjWkWlyqF7biaCK8BpIOCM5wpmA/eTeU 3MIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2si2648031pgo.9.2018.03.01.08.22.18; Thu, 01 Mar 2018 08:22:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032916AbeCAQVc (ORCPT + 99 others); Thu, 1 Mar 2018 11:21:32 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:42470 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032704AbeCAQVa (ORCPT ); Thu, 1 Mar 2018 11:21:30 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D5980F27; Thu, 1 Mar 2018 16:21:29 +0000 (UTC) Date: Thu, 1 Mar 2018 17:21:30 +0100 From: Greg KH To: Quytelda Kahja Cc: christian.gromm@microchip.com, devel@driverdev.osuosl.org, Michael.Fabry@microchip.com, chris@engineersdelight.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] staging: most: Replace calls to BUG_ON() with WARN_ONCE() and return. Message-ID: <20180301162130.GB15087@kroah.com> References: <20180224075835.11618-1-quytelda@tamalin.org> <20180224075835.11618-2-quytelda@tamalin.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180224075835.11618-2-quytelda@tamalin.org> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 23, 2018 at 11:58:33PM -0800, Quytelda Kahja wrote: > Replace calls to BUG_ON() used to check for NULL pointers with WARN_ONCE() > followed by a return. Are you sure this will work? > > Signed-off-by: Quytelda Kahja > --- > drivers/staging/most/core.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c > index 18157dd80324..3f65390a6e17 100644 > --- a/drivers/staging/most/core.c > +++ b/drivers/staging/most/core.c > @@ -916,7 +916,11 @@ static void arm_mbo(struct mbo *mbo) > unsigned long flags; > struct most_channel *c; > > - BUG_ON((!mbo) || (!mbo->context)); > + if (WARN_ONCE(!mbo || !mbo->context, > + "Bad mbo or missing channel reference.\n")) { > + return; How is the code supposed to recover from this major problem? > + } > + > c = mbo->context; > > if (c->is_poisoned) { > @@ -1001,7 +1005,7 @@ static int arm_mbo_chain(struct most_channel *c, int dir, > void most_submit_mbo(struct mbo *mbo) > { > if (WARN_ONCE(!mbo || !mbo->context, > - "bad mbo or missing channel reference\n")) > + "Bad mbo or missing channel reference.\n")) You did something different here that you did not describe in your changelog :( thanks, greg k-h