From mboxrd@z Thu Jan 1 00:00:00 1970 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 CEFED53B7 for ; Wed, 9 Aug 2023 11:04:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E2A3C433C9; Wed, 9 Aug 2023 11:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1691579051; bh=HTtf9RAHQHcFLC25G1RlGP+CjtuK5vm/xmPpJgK9ORw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BAs48DkfsB2doUIpM/cDLlFNllvn2tGWinxzxKV97rCWlj/lssF1wxvrShroyv1sP gE4wvs/NkpNghO/K4oDwp/fj4Qr5ECbqeUTlanJKWmkRjYvru0j1RlPJ6LuNsdiVNX FD4ra5bpSl8q31Q/zwZ6UiJgG+agoSlxEQyzr+3Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Daniil Dulov , Hans Verkuil , Sasha Levin Subject: [PATCH 4.14 058/204] media: usb: Check az6007_read() return value Date: Wed, 9 Aug 2023 12:39:56 +0200 Message-ID: <20230809103644.550140933@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230809103642.552405807@linuxfoundation.org> References: <20230809103642.552405807@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Daniil Dulov [ Upstream commit fdaca63186f59fc664b346c45b76576624b48e57 ] If az6007_read() returns error, there is no sence to continue. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 3af2f4f15a61 ("[media] az6007: Change the az6007 read/write routine parameter") Signed-off-by: Daniil Dulov Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/usb/dvb-usb-v2/az6007.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb-v2/az6007.c b/drivers/media/usb/dvb-usb-v2/az6007.c index 1414d59e85ba7..1830badb180d8 100644 --- a/drivers/media/usb/dvb-usb-v2/az6007.c +++ b/drivers/media/usb/dvb-usb-v2/az6007.c @@ -210,7 +210,8 @@ static int az6007_rc_query(struct dvb_usb_device *d) unsigned code; enum rc_proto proto; - az6007_read(d, AZ6007_READ_IR, 0, 0, st->data, 10); + if (az6007_read(d, AZ6007_READ_IR, 0, 0, st->data, 10) < 0) + return -EIO; if (st->data[1] == 0x44) return 0; -- 2.39.2