Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2483127pxj; Mon, 10 May 2021 04:11:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZprTxwk7CVM/rUE/znvIe6qQJbkss2JLP6FWyCGolTftpLCC9i6SxQjNkRxcg3ihwXYrj X-Received: by 2002:a02:b398:: with SMTP id p24mr21389029jan.74.1620645062972; Mon, 10 May 2021 04:11:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645062; cv=none; d=google.com; s=arc-20160816; b=00m+sV9VTo3tAyP2YLDSRnbHGyF8pCIp/exdUdcGCxIWvvLBRagCXs17fjN5IQ3VPo JG2YXsoTMaqpZKhjQQgnfbaS11mrVeNefVISI6QMlxPxDQ4Os3VfYD0hNIxIkVmSR4EP lVLx1kxIU/kDSJ67BCuwnCG+jvPHsd8fhsP29rEIimRIqt2XosCNrFoakglCdelOIaf7 nBdmiWYh3VaRPTkr4+OdDbqFGKrL46U8+fzQMTCjRLdzVT7O3Kcw9dhvVHENxsJdbMvB UBpPpvwVUxj2AiFXRICqwJaZgCHv0wOomqMFBsEEY8yL9eJ0ZOfzjJkGkkE7pM6bdLcC FuYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=38aX+GI8E1MI+X3+l3SrO8dTCd0hyZpEWc0Pvx2B530=; b=YCh5UhX5NXmuh8UMynwtqYuC8LFv4IstlAMT7UYo49sgUk/AsEJie9YBJ4smhswVu5 j6yKUKGwmmeiyiVoAbFgxAFYJvSm2kpjMDQGHXdja2ylwDe/Ey4XhUSWAyZJwi430GWS ft5KHb5yW2TPKtm0g1btHUW8aaHhv0X71sNQRDJxAMWFoYOwfJVpyvaTK5kqWyKuzYyG MECMxlpEWHtVAjVbi2u/xGFUrDBsgU99MfyNzQ42Fqs/ACveIdHW8Uwpy/wCa0L0BchP pCxXmOPAVRaQTfH99HifvJtUIQWom+0uZ1Oq2Rnv2L+LNBkrMvnrrPqvqopG4cXzPzIC 4JJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HCyAou6E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t1si15088477jap.32.2021.05.10.04.10.49; Mon, 10 May 2021 04:11:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HCyAou6E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235598AbhEJLFl (ORCPT + 99 others); Mon, 10 May 2021 07:05:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:32906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232503AbhEJKp4 (ORCPT ); Mon, 10 May 2021 06:45:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CB9656143C; Mon, 10 May 2021 10:36:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642998; bh=5LnsDbENCZlQF4nCWMHw2rIS0V68TkYnwy3mGlCDfCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HCyAou6E5GZIj2XtYIZvENUPS6lcgvpw62OyQU1RlKF0u0VjFlA55v+LDzPHVyMNj eA8iQE99vPUAnWRDMQicZJ7nT6cH9Iau+XIkxoVjKXaF9cZg5TqFpe4dvBJ2+6s713 lY+UcKbmbNoMPtN2hoRKzoVDDywfcINS9zHce+5Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , syzbot+a4e309017a5f3a24c7b3@syzkaller.appspotmail.com, Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 137/299] media: gspca/sq905.c: fix uninitialized variable Date: Mon, 10 May 2021 12:18:54 +0200 Message-Id: <20210510102009.494905422@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans Verkuil [ Upstream commit eaaea4681984c79d2b2b160387b297477f0c1aab ] act_len can be uninitialized if usb_bulk_msg() returns an error. Set it to 0 to avoid a KMSAN error. Signed-off-by: Hans Verkuil Reported-by: syzbot+a4e309017a5f3a24c7b3@syzkaller.appspotmail.com Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/usb/gspca/sq905.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/gspca/sq905.c b/drivers/media/usb/gspca/sq905.c index 97799cfb832e..949111070971 100644 --- a/drivers/media/usb/gspca/sq905.c +++ b/drivers/media/usb/gspca/sq905.c @@ -158,7 +158,7 @@ static int sq905_read_data(struct gspca_dev *gspca_dev, u8 *data, int size, int need_lock) { int ret; - int act_len; + int act_len = 0; gspca_dev->usb_buf[0] = '\0'; if (need_lock) -- 2.30.2