Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3237492ybl; Sun, 25 Aug 2019 11:18:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzo0SOcRu7x59ii2OOXEJjNncGBOF24QW7+N3AOiEbSLHXy6zRg9DXYr/ed9F+HbKtaMwkg X-Received: by 2002:a17:90a:ae15:: with SMTP id t21mr15855881pjq.50.1566757135334; Sun, 25 Aug 2019 11:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566757135; cv=none; d=google.com; s=arc-20160816; b=WfaCZGMbGij/DZtfKEo09zJzVG4j5wFkM6rrU31VAYHYNgD1w9Y7NAiPivfU4TKEWJ CCUxcMNaJp/km4ZpCXci3DBCnmECVDihvQn4/u4Jpfz8ST6SUCDShd5+Ocx+vRIcGs5p mZ231kas1F8ceMupfqA79+kxKUFzOuOAQ02VTXjMoB2q+48ipta2klKY9QCQL9E8XUqi PYTosK6tNv/gkc6kUlt1fxvCE9NTSaNDdrSVzCJWcfAEcaYNX4QziQ2p0/DxxRKnIPue y7OhrELw9FpH1kQL36l64ysYVlAB9BhmdpSI7nFa6c5lZdypQsULnaiEIq6GnaQ3bWQ1 +2xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date; bh=AmMbghhbbC8vAp+uashRb8pSCODfDJpi9/hh0UQuoZU=; b=qi6QzCTsL6bq99KC/Q675qlAMEU1rBMs2yod5Kdml31qCX9SJjCh1GEY+SntAh1dto lu1NL+WSxZ6KfOiSjFlZmB68SlBCDPzaQ8BRssO7D3Bk/T80yC8S6QHS6N30hCdo0oTL aF2otCk/mhdF4Iz7ntshssYYBvC/ta85Ihk3rHpgvmyXjGqWtxg/PhAqByP/7RNFlkbq k/nxZqBl6uuP6vxRJzezqyuzXgHX5SSZQ6Qm0BW3bZJhZ665eHK9/SUDOvsOJ0l8+QGb s44SGkl9CWNSTCK+9JZAwRLpw2e2vJu9rQ+YQ01hDUT0EHNwN4omLEnAvtqfnBvNizr8 cDsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i133si6572431pgc.109.2019.08.25.11.18.40; Sun, 25 Aug 2019 11:18:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728705AbfHYRwZ (ORCPT + 99 others); Sun, 25 Aug 2019 13:52:25 -0400 Received: from cnc.isely.net ([75.149.91.89]:46025 "EHLO cnc.isely.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727835AbfHYRwY (ORCPT ); Sun, 25 Aug 2019 13:52:24 -0400 X-Greylist: delayed 303 seconds by postgrey-1.27 at vger.kernel.org; Sun, 25 Aug 2019 13:52:24 EDT Received: from lochley (lochley-lan.isely.net [::ffff:192.168.23.74]) (AUTH: PLAIN isely, TLS: TLSv1/SSLv3,256bits,DHE-RSA-AES256-GCM-SHA384) by cnc.isely.net with ESMTPSA; Sun, 25 Aug 2019 12:47:20 -0500 id 000000000014205E.000000005D62C9A8.00004CB9 Date: Sun, 25 Aug 2019 12:47:20 -0500 (CDT) From: isely@isely.net To: Yizhuo cc: csong@cs.ucr.edu, zhiyunq@cs.ucr.edu, Mauro Carvalho Chehab , linux-media@vger.kernel.org, Linux Kernel Mailing List , Mike Isely at pobox Subject: Re: [PATCH] [media] pvrusb2: qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns error code In-Reply-To: <20190821210931.9621-1-yzhai003@ucr.edu> Message-ID: References: <20190821210931.9621-1-yzhai003@ucr.edu> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Acked-by: Mike Isely On Wed, 21 Aug 2019, Yizhuo wrote: > Inside function ctrl_cx2341x_getv4lflags(), qctrl.flag > will be uninitlaized if cx2341x_ctrl_query() returns -EINVAL. > However, it will be used in the later if statement, which is > potentially unsafe. > > Signed-off-by: Yizhuo > --- > drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c > index ad5b25b89699..1fa05971316a 100644 > --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c > +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c > @@ -793,6 +793,7 @@ static unsigned int ctrl_cx2341x_getv4lflags(struct pvr2_ctrl *cptr) > struct v4l2_queryctrl qctrl; > struct pvr2_ctl_info *info; > qctrl.id = cptr->info->v4l_id; > + memset(&qctr, 0, sizeof(qctrl)) > cx2341x_ctrl_query(&cptr->hdw->enc_ctl_state,&qctrl); > /* Strip out the const so we can adjust a function pointer. It's > OK to do this here because we know this is a dynamically created > -- Mike Isely isely @ isely (dot) net PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8