Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2387543lqp; Sun, 24 Mar 2024 17:11:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvXGg2R8D95Ng3bdOQZqf1AUbAbGXG5KgwHOTnFf/RHWKEf19qnns30UrPLyjGcfpn2MBYHC0mdiKZRY9kL28EOHNfHKbUoPoX6UZNHg== X-Google-Smtp-Source: AGHT+IHYO5/O6Ccg027jQP60+RB1Z1aQ4kTCmTTWfzqreNeRqdfAkLMNmMiz79Fwli85bf4jJCzh X-Received: by 2002:ac8:59d4:0:b0:431:5aa3:1231 with SMTP id f20-20020ac859d4000000b004315aa31231mr1372369qtf.62.1711325475601; Sun, 24 Mar 2024 17:11:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711325475; cv=pass; d=google.com; s=arc-20160816; b=0BGq2195SGE9mshlnE2pwRJ1I6h0mQcyDM4B8+T40u1ewVWNougyWtb84EmOIEHsC+ ODoST0sy120bsJTeA9pb1GPe4s+DLWMWdXRyqNsd1JAAuZh18XSMjAKU9uhuix7i9Vwn utv4ZuE/a1th6iJqwwiqo5owzQG8u2LcHB/zqJTPI4VFZKGVhOCSVE3bJ+yVliPgwrld yT9XseJiEO+lBhm6wq5m+AAsQPknOGsKzUh1lZ7NJBVsYrtWvPXr8ZChjWmYP4tWLS2M tPDOMqDvXVnLrBFEa0JIt0lNGfNdaeSmzdYs1wMQLcsMjY2qcc94MmdSCsve6hVetQ2W tu/A== 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=fxVkp5+2J0pgv1WuvIJix3onrsBAxfGcbW1qh6Y+R678JW1LE0RFWl+nKPjp7DvwhN SzXv4TPozHE7OyR0nX5kHO89of4Rn1s7p0Jcv1+iolb/4UJNPgGPuDxzRiHObTqPGYEp 7pfSJ91EyJrQm7pcqymXC63IOfrCWPb0MOLk9R8TglAq15iPzSatgQrAfjliuVj+Jes9 Rd3xGCXmM2JwnkT1izdkuVoajaeEFgm30EoIGE3WAaM7MgaTUjbj1RZ2BcgeoIBitR2N MFujZV963/ToSwR6lfDLLeaMN+ZLrfcq7rjBKRy24wQPWj0QHnCbyD2gh5CChWWTN37Z ggqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fFBv5zeO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113330-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113330-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id n8-20020a05622a11c800b004314570b226si3464639qtk.383.2024.03.24.17.11.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:11:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113330-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fFBv5zeO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113330-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113330-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4CA5C1C23907 for ; Mon, 25 Mar 2024 00:11:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6BB446D1A1; Sun, 24 Mar 2024 22:42:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fFBv5zeO" 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 8B964195FE8; Sun, 24 Mar 2024 22:42:11 +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=1711320131; cv=none; b=ErFtPPzHpWcgKJneqfRMQbsKRbc93sNK6iEg9l/8d7r6nmtJknBbIKUqWx2ZHG2tOOXUhaf2sF1vXBbK0ILaG59q82dY6Pwq3/VNEeE0ZokEtkl5RDStiDYxQF39bJdGGsIc+efEZuOvNdwxzsleQtcnFjPrUaahi72/3vuOCmk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320131; c=relaxed/simple; bh=BApVoZr1HWgG77uIAlP5say5xUHr6e9CzMP/GXvg8hE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OfzYc5DM7510KdNfswhWrgLboHY9609j5j2dyMuoNaaT7C/eokGXElhX+LliS5VffUAE6nzeKTYaKV06x2ioxHPlA6Kj+R2sRwvi0WTHJVg9gcm8Z7O5l7ZP8O5/5bmzWz4BLa2iCAGJPWPGMD9DkanR0Y8AJN2iiPRQYI01HVc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fFBv5zeO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF8EAC433C7; Sun, 24 Mar 2024 22:42:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320131; bh=BApVoZr1HWgG77uIAlP5say5xUHr6e9CzMP/GXvg8hE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fFBv5zeOaVRaELDr7aTUmkBrWutTFG3IUUm7KLWUl1gVCKWQXalzCHeX6EzjCVEFk 2Rassr2G2mk99BG86kOmYR7QqBvFBXf8BH3uwIEysRkg0KoURSbse/28FcGY033Fgc nQ2XbSr0s56Q9ual878uLLC3X9PqYp1rDs8OsaM6A1At8JWTRlAn/TZv2L607aCoKQ T8bs3W9jYcEzJrzsB3DPbrxdCz4UMYGhYXF1YhJ5yvXr7eNbVb8/3DpJUHRJuMQTNf zqURhypq9oYQrTb7Yjp3QwYdtL0PBAaSsIhT01al93KFR0PfZmrtAk1fkE/fXxzAdk SlTfvI+6YMo+Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Daniil Dulov , Hans Verkuil , Sasha Levin Subject: [PATCH 6.8 439/715] media: go7007: add check of return value of go7007_read_addr() Date: Sun, 24 Mar 2024 18:30:18 -0400 Message-ID: <20240324223455.1342824-440-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-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