Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2568463lqp; Mon, 25 Mar 2024 02:58:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVoG7TjFuxUwFiiEu5XRwr6qUDNYVJJyY5wscg9L91q7EO4HeK+IG24VN+kMhBfI6Uzjga3tP5jucBtfD73e0OALJtcadGk0X1tb2cFjA== X-Google-Smtp-Source: AGHT+IEyCgNHl3k/q//dzjTp6KzOpJXzROnTe2R9YuJbgPmQ2dWdq7bxHBaP/YWiXPGtsYYsibj7 X-Received: by 2002:a05:6a00:4607:b0:6e8:f708:4b09 with SMTP id ko7-20020a056a00460700b006e8f7084b09mr6459981pfb.15.1711360696180; Mon, 25 Mar 2024 02:58:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711360696; cv=pass; d=google.com; s=arc-20160816; b=uOfxE/HNVFxiBa5ZlNO8d0iYXg3YjIYyU1IhXz24fRPJSfTTkziTzUOHOt0s8gX9Va 0S6TBFLiblG482rBrCnGt0gPlUNhB3P/kh4zUt3x7ae5khYI9N7ynmPOsVvzqePLR9PM 2iI/xZk4IXV7O87mACVGeei4isNpTz4k/RZGteuZEOOSko0esRAxYzE1rhiKS0tikq2U XrL/2eaGq9QZ9TpyqwCly7dGXXxqtQrMWrAvmjR5e+21JjrcoiYpIoYKTyWGqPUKE7bj ARHb40Xvc3ERouELUh+2eBlSGvctTuKSskqkqIapGdSPeBHEB/mdRY2w0KgaxoSW0EL/ hqAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XtZSnU8XF6Ahf4ki9Tc9DMmWL7GOqdCq0Tc4+M4HSCU=; fh=4yftrWz4Cye0AGLnP1Q5VYayz020Nvtkc3evrRIWKzY=; b=LK3ZgyKrotHzay2kNCqQMbUMpFzGRdoBdhnnZmp15BrOJltlBBjZKbAzBSuIiV40hM zFfD/fCKAHYo8uthFrREShW+CcioF7uqYGFIXjoYdX/ZZ5576S9Rk6vyG2NYdpYgk6US e7cJAw2zhsq38d/ud8z9t+kp6m8/P6o+694r7RsyLF8pXzUXz1M07eFI/ENY9ZjAFBol Pe+ySs1wS9MqLwWatEgYCrwqJ8z5MXiG/JLaeSpIWphvdMM6yOKV9uWkTGmspKS3Ma4z VkoH588wsPv/TBDKDBr5fT/fowNwpabcCdVrjR6i9LUMv1jTCd+g/QTEKT2xra41Doza 8KRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nbFsb5Fp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115958-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115958-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r14-20020a632b0e000000b005dc7f609bb8si7152926pgr.644.2024.03.25.02.58.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:58:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115958-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nbFsb5Fp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115958-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115958-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4962229FD32 for ; Mon, 25 Mar 2024 09:54:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8739C39281D; Mon, 25 Mar 2024 03:04:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nbFsb5Fp" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C1721FDA13; Sun, 24 Mar 2024 23:17:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322222; cv=none; b=hppaV+AWbg/QCzKjQ6zz9OpS2GuvuCAtmW3Qedqg8WE2gCCO84gF2+BAnix01u/PF5y0NliWkX9QKt3IGWlNqLsP+uwMF12Ukkomvcb3D5+gmo+WxHjbonaunh1c8Al38a/bvmURZ93ZVMonZZNHTZHjB12MAUBdjUE994XTNR0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322222; c=relaxed/simple; bh=BApVoZr1HWgG77uIAlP5say5xUHr6e9CzMP/GXvg8hE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SxmUTf12FOh3I8pTdIRgNlTqyyFKofhcXofNxE1x1K30zsgpQYkQXdNe7D0ezm50bbwrQdEbhm2w+2ZeAplP0PaEF7Mr08NF/4CrEPpnhnI3rGOEr0kLY8r7yxsROyXAv8AxgSBuXkwNc0WlAjPteTrYe7ckRDmKN4MAcAFqYjQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nbFsb5Fp; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 596B3C433C7; Sun, 24 Mar 2024 23:17:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322222; bh=BApVoZr1HWgG77uIAlP5say5xUHr6e9CzMP/GXvg8hE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nbFsb5FpEKkuxwE8U1+uvtmYo6MS9HHcLgaMyHDGwnkM3m8LuR86CAJvS74bR3tc3 e5ZcEnqqmbJij2Jyj6AxVaRWbHuq37e05mGAbY6bMESgEuVAuU9QfN0nGIriLAMF9a k1+9aIwtBzFEj/gRQK/QtUSCGbtLHGl+NGg1h75kmxA8EO84A4wfeR1hs0AB4x4IkM b/TvxY0t1Oa4BDTgeBYeKI6P+ckpMLp5djufedAHVYuKPgOmHnb2tw0XuUxy8DWYC5 jaIqHJf2d+Lj3/6YqtDKgN16NeRgOAhKKihsfwthRQC0cSZxQKFlRjSAS6kKQDMheJ DdfERoffcZhSw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Daniil Dulov , Hans Verkuil , Sasha Levin Subject: [PATCH 6.1 302/451] media: go7007: add check of return value of go7007_read_addr() Date: Sun, 24 Mar 2024 19:09:38 -0400 Message-ID: <20240324231207.1351418-303-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Daniil Dulov [ Upstream commit 0b70530ee740861f4776ff724fcc25023df1799a ] If go7007_read_addr() returns error channel is not assigned a value. In this case go to allocfail. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 866b8695d67e ("Staging: add the go7007 video driver") Signed-off-by: Daniil Dulov Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/usb/go7007/go7007-usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/go7007/go7007-usb.c b/drivers/media/usb/go7007/go7007-usb.c index eeb85981e02b6..762c13e49bfa5 100644 --- a/drivers/media/usb/go7007/go7007-usb.c +++ b/drivers/media/usb/go7007/go7007-usb.c @@ -1201,7 +1201,9 @@ static int go7007_usb_probe(struct usb_interface *intf, u16 channel; /* read channel number from GPIO[1:0] */ - go7007_read_addr(go, 0x3c81, &channel); + if (go7007_read_addr(go, 0x3c81, &channel)) + goto allocfail; + channel &= 0x3; go->board_id = GO7007_BOARDID_ADLINK_MPG24; usb->board = board = &board_adlink_mpg24; -- 2.43.0