From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CE9CEEB57F for ; Sat, 9 Sep 2023 00:43:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346223AbjIIAnm (ORCPT ); Fri, 8 Sep 2023 20:43:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344958AbjIIAnU (ORCPT ); Fri, 8 Sep 2023 20:43:20 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 557AB3C3B; Fri, 8 Sep 2023 17:40:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C36DEC433C9; Sat, 9 Sep 2023 00:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694220032; bh=6bMlvEPeEqUTG7glKjMyl1iDesJ2uJQAP14I+uqgCxs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IGOGT+Mu5v9Wxy7hozQo84+mpRGO+myo1hwLD3t87hm1scK4JSIYYXjKUzy/HjXur 8QPIpSYznyWD0B8Z2w9EAPV0u6Zrz18Q5URWJNRsoAYDb11Mdua9jhPWZFQY78jFfP ZUA2RTjLRAaaFonxbKbn73KNAJrKdw3HivrmZqV880dUi+0AQm1FFixQycujKw55D7 AS4q7sbI1Me0wtHv6Q8Fg0idey9lx/gImu/E1sSbsRDlnG8caIfTyxPiN1+AKM4k/3 ZeZmNo/Zf/queT28viBC9vl58pxiu3gUY3iP1tJ5DyjH+Hu/gx6Uz3jiSt88amiY+q lyDvwxYzjBwxw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hans Verkuil , Sasha Levin , mchehab@kernel.org, harperchen1110@gmail.com, linux-media@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 08/14] media: pci: cx23885: replace BUG with error return Date: Fri, 8 Sep 2023 20:40:08 -0400 Message-Id: <20230909004015.3580832-8-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230909004015.3580832-1-sashal@kernel.org> References: <20230909004015.3580832-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.4.256 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans Verkuil [ Upstream commit 2e1796fd4904fdd6062a8e4589778ea899ea0c8d ] It was completely unnecessary to use BUG in buffer_prepare(). Just replace it with an error return. This also fixes a smatch warning: drivers/media/pci/cx23885/cx23885-video.c:422 buffer_prepare() error: uninitialized symbol 'ret'. Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/pci/cx23885/cx23885-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 7fc408ee4934f..f56b271db8bea 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -409,7 +409,7 @@ static int buffer_prepare(struct vb2_buffer *vb) dev->height >> 1); break; default: - BUG(); + return -EINVAL; /* should not happen */ } dprintk(2, "[%p/%d] buffer_init - %dx%d %dbpp 0x%08x - dma=0x%08lx\n", buf, buf->vb.vb2_buf.index, -- 2.40.1