Received: by 10.223.185.116 with SMTP id b49csp1605698wrg; Sat, 24 Feb 2018 00:00:30 -0800 (PST) X-Google-Smtp-Source: AH8x226C+OEwlI0kHoNtyuQvrtQwTdgVsA8Z5YQtAifec5U8iJLLlclODR2Or2BHXU8cgbg/+rzw X-Received: by 10.99.110.131 with SMTP id j125mr3477432pgc.382.1519459230346; Sat, 24 Feb 2018 00:00:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519459230; cv=none; d=google.com; s=arc-20160816; b=OpI5+9RrD0TF5Ii8esxhZw8h9VzFxO/OxSwbgtju36goAjgQYUfaANUhDR3MPVXbP+ NeGZ/NRJY5S01LWUBlPV9hdhH3Afy4hYkv6gibOPH5Z9kkMgdHUdnprXB2mcOoiJ3LNV Ilg9bQZbiW4YQJdZnk/juB6ymyoEpK1g95Nj21DB/tSn0HS9WTozcS/At2UMicY+kAtV mHZLWzfSFXSjYi7gkk99DEMX+01R7UMTxSx9eFm5mVsjZip7lNouMOVK5AVEm9LIllAG UnwmXXSRnA0+krAxFhcyryAGZPDprcaab3WtrHGJPeg80dqBgWAsAzT8I854UucDNcTn HA/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=d0cvGkwOu10jcX+g/uulFpcKCmNhAtd/bJAiBgK0Znw=; b=RZdhVYqKpTUtBB7//d3FNiuBp/qWggUeGLYgfqYdLzX136VzuTzhOoLgTL+SWofh+c JeiGa2uXxJKn72KXSrvA06+J3BczOsKiZh9WjGt77n4+Aq7S7+AEvz1Vkw2Q4TzMTSpk k4zIMqyip/bYJd7INWohXlUEFg30qtkHj8ktpoNIEWGOUSF0Fqxbkt/Xq7HkWPZIqNO0 KQDTDjTJttet22SKbjn9rRW67wx/oDJpFMt6VLnlcF5sKWGvVZTk4aqPWu/e9JExscwj FMVvZkCwpXPiOtC7P+D4KCct1qkvFKMnrjdEhzQduxS8KhJSvXEXsTAgLUpEJ+lYqMlx 0PRA== 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 21si3202753pfj.306.2018.02.24.00.00.16; Sat, 24 Feb 2018 00:00:30 -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 S1751416AbeBXH7Q (ORCPT + 99 others); Sat, 24 Feb 2018 02:59:16 -0500 Received: from mout.perfora.net ([74.208.4.194]:57753 "EHLO mout.perfora.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751302AbeBXH7N (ORCPT ); Sat, 24 Feb 2018 02:59:13 -0500 Received: from kahja.local ([73.170.116.139]) by mrelay.perfora.net (mreueus001 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MJlT8-1eqbCC39KW-001DnY; Sat, 24 Feb 2018 08:59:09 +0100 From: Quytelda Kahja To: gregkh@linuxfoundation.org, christian.gromm@microchip.com Cc: Michael.Fabry@microchip.com, chris@engineersdelight.de, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Quytelda Kahja Subject: [PATCH 2/4] staging: most: Replace calls to BUG_ON() with WARN_ONCE() and return. Date: Fri, 23 Feb 2018 23:58:33 -0800 Message-Id: <20180224075835.11618-2-quytelda@tamalin.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180224075835.11618-1-quytelda@tamalin.org> References: <20180224075835.11618-1-quytelda@tamalin.org> X-Provags-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vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace calls to BUG_ON() used to check for NULL pointers with WARN_ONCE() followed by a return. 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; + } + 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")) return; nq_hdm_mbo(mbo); @@ -1019,7 +1023,10 @@ static void most_write_completion(struct mbo *mbo) { struct most_channel *c; - BUG_ON((!mbo) || (!mbo->context)); + if (WARN_ONCE(!mbo || !mbo->context, + "Bad mbo or missing channel reference.\n")) { + return; + } c = mbo->context; if (mbo->status == MBO_E_INVAL) -- 2.16.2