Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp150818ybl; Wed, 21 Aug 2019 16:34:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtrBbR10wmIXBCOdSAFIsJGPIOUFtbEOsG6yCEPdHTdsVSpD/fb/QtgGHBPGOhG80x29GY X-Received: by 2002:a65:43c2:: with SMTP id n2mr31509844pgp.110.1566430443057; Wed, 21 Aug 2019 16:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566430443; cv=none; d=google.com; s=arc-20160816; b=X3lgC5fuwtQM3gY3JTtQd1coiYFaJ1+Q72Kx3E8SrgR0sh66vodoWsNlnIv4Xtebza GAti2IGSjRBHBiptU92OT84EpIBgqv6IiiZLaMCmutFQ8jgqtOu1cvUIaaIRrswgQQ+k RuWW0L6FEYaI8NYQWEMBteASvhoM2zrg9brZTff2bV4gMTQXD0uxmdWMaGtyLREMdJ/l HYtPS9VaCL73h6A9JGOsii9lE9XF9ac5K21ElzNCoJWCmGe7q01YvZXrEn/bo3/GpPiN UVA4WlHxmlHCvqUPY2veY331EylC4S+dAle676tHY6aZ0aJb9OyX+CdbbBr0tNFfDzCi Y+Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:date:subject:cc:from :ironport-phdr:ironport-sdr:dkim-signature; bh=KPS5jpp4Ywj8sRwhNiLpJFreklEq0lOjofl+ZAU4qJQ=; b=RICDR4IaL9XRs7QxqKGOFgHDLfW81gmsTfetvJiythzUvYPnAjjUK4we0xYWOFARHJ Vcv2iZGo1SouA0LIBxvyIaP0gVBgk5L5n926JRmJ0IQ5B9S/ldwKYzwV6qj9DuXHzu8A zjz63eh4yZPoUO2lm4f45ct5klueCwQpWShcbLrkTOlwZb/vDOe4EGy4ad7OOUkUn5oi gtZXlrXpN3e2Tj/fUZjGoUlaQlXMat9q1QWS1V6tqv6yd9i+pRSepVFOQ0YeeR++QWqe 4ERu34svBe16n1/scp5nhFn4/cwQaf532yPbmWH/GiNOc3t72FFhU26uNOC0IJJLxFlO OBWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ucr.edu header.s=selector3 header.b=XAN67aA8; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ucr.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si9217382pfe.173.2019.08.21.16.33.47; Wed, 21 Aug 2019 16:34:03 -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; dkim=fail header.i=@ucr.edu header.s=selector3 header.b=XAN67aA8; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ucr.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730834AbfHUVQT (ORCPT + 99 others); Wed, 21 Aug 2019 17:16:19 -0400 Received: from mx6.ucr.edu ([138.23.62.71]:41824 "EHLO mx6.ucr.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727629AbfHUVQT (ORCPT ); Wed, 21 Aug 2019 17:16:19 -0400 X-Greylist: delayed 426 seconds by postgrey-1.27 at vger.kernel.org; Wed, 21 Aug 2019 17:16:18 EDT DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ucr.edu; i=@ucr.edu; q=dns/txt; s=selector3; t=1566422178; x=1597958178; h=from:to:cc:subject:date:message-id; bh=cBdSPmFTN1DOzz1EeXVkXTHdBWMI8uVVtsHBkBxazoQ=; b=XAN67aA8hwBJ71ULZIHGlLOWYdw2A5myY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jhSkbOzIl9mzcl9d9h7xHrh2/uxN/wpbUYICLO/p4YqPdZs4RSW?= =?us-ascii?q?5YUspMSyBNHoawYo0KD+oAJuZYtIj9p10BrRCjGweiHf7kyjFJhnDo2a01zv?= =?us-ascii?q?kqHQXI0QA8Gt4DtmnfotfoO6cISe27zLfGwyjNYf1V3jnw85TEfgw7rP2QR7?= =?us-ascii?q?98bdbdxE8yHA3FlFWQronlMiuX2eQMsmmb7/dgVeWygGMgqwBwozivyd0tio?= =?us-ascii?q?XVmo4YxEvJ9Thlz4YvP9G3VlN0YcO9HZZWqiqUNJN2T9s8T210vCs20L4LtJ?= =?us-ascii?q?6hcCQU1ZgqyATTZ+Kbf4SU+h7vSeecLDNiiH57dr+yhwy+/Vahx+HmVMS531?= =?us-ascii?q?BHpTdfnNbWrHACzRnT59CCSvt640iuxy6C1xvW6uFYOUA0krfbK4I5zr4wiJ?= =?us-ascii?q?UTtUPDEzfzmErsja+Wclwo+vCs6+j6e7nmqIGQO5Nohg3kPaQuncu/Aes8Mg?= =?us-ascii?q?cQRWSU5eO81Lj78U34RrVFkOE2n7HHvJzGIckXvK20Dg9P3oo99hqyAC2q3M?= =?us-ascii?q?oEkXUbNF5FfQiIj4ntO1HAOvD4CvK/jkyskTZqx/DJJLzhDonRInXNi7rhYK?= =?us-ascii?q?py61RGxAUt0N9f+opYCqsdL/LrRk/xqNvYAwc9Mwy1xebnFdp82podWW2RGK?= =?us-ascii?q?+ZNr3dsVuT6+IxLOmDepUVtCz+K/c7/f7ui2E2mVsHcamux5sXZyPwMO5hJh?= =?us-ascii?q?CoYGjsn9BJRXYYvgM/FLSxoECJS3hea2vkDPF03S0yFI/zVdSLfYuqmrHUmX?= =?us-ascii?q?jjEw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2FXGgC4sV1dgMjWVdFkHgEGBwaBZ4M?= =?us-ascii?q?FUkwQh2mFMoZTAQEBBoNAKIc1GHGFeIMIgWOFOwEIAQEBDAEBGxICAQGBBIM?= =?us-ascii?q?7gl8jOBMCBQEBBQECAQEGBAEBAhABAQkNCQgnhTAMgjopgUxfNQsWFVKBFQE?= =?us-ascii?q?FATUiOYJHAYF2FAWeD4EDPIwjM4N3hH8BCAyBSQkBCIEihxWEWYEQgQeDbnO?= =?us-ascii?q?CSIUbgkQEgS4BAQGUNJVvAQYCAYILFIFvhHmNRSeDHoEOiRSLBQEtg36dTYN?= =?us-ascii?q?xAgoHBg8hgUaBek0lgWwKgUQJgnGGBIgpHzOBCIxCAQ?= X-IPAS-Result: =?us-ascii?q?A2FXGgC4sV1dgMjWVdFkHgEGBwaBZ4MFUkwQh2mFMoZTA?= =?us-ascii?q?QEBBoNAKIc1GHGFeIMIgWOFOwEIAQEBDAEBGxICAQGBBIM7gl8jOBMCBQEBB?= =?us-ascii?q?QECAQEGBAEBAhABAQkNCQgnhTAMgjopgUxfNQsWFVKBFQEFATUiOYJHAYF2F?= =?us-ascii?q?AWeD4EDPIwjM4N3hH8BCAyBSQkBCIEihxWEWYEQgQeDbnOCSIUbgkQEgS4BA?= =?us-ascii?q?QGUNJVvAQYCAYILFIFvhHmNRSeDHoEOiRSLBQEtg36dTYNxAgoHBg8hgUaBe?= =?us-ascii?q?k0lgWwKgUQJgnGGBIgpHzOBCIxCAQ?= X-IronPort-AV: E=Sophos;i="5.64,414,1559545200"; d="scan'208";a="71679617" Received: from mail-pl1-f200.google.com ([209.85.214.200]) by smtpmx6.ucr.edu with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Aug 2019 14:09:12 -0700 Received: by mail-pl1-f200.google.com with SMTP id j12so2215309pll.14 for ; Wed, 21 Aug 2019 14:09:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KPS5jpp4Ywj8sRwhNiLpJFreklEq0lOjofl+ZAU4qJQ=; b=fP2P9c6QtOb4rICOZCLfCmswWdP6JE71EpL9m9gquay7BiIBmZpLt0QBD96kaEAklf O7tDh1NYgJEX0s0/pXpWCMoSzLANxRWdT7lnv1LoGzlwOg6KEWnliAuVeUBtOYQvZeEC tocjcJIsfQsFNB9vwUBxVXAnJdd3gr9cIJB80uIY3KlzbOF5426i6uf8ACz+gdSlbOJF pLTNQ4BZ07Vtb/whCa82AnLVruT3KcB3HzdcEWLkb/FkjQbpiLEV+TTLzu69GLuCeNuu jkUU9JuT8s545mRoAZwTgtIqyXlqbWz68lDuFLTrYiPS9pVfAhYTwevaUOfGTs+5tM4z KiIA== X-Gm-Message-State: APjAAAXcu6GwVMkZfhDe7PN+ja/2+kCO6A9eFerg43cyX85HuDirloLT 0PUzHL5gYZFG61PPe8FdPOeGSix2UGSZpdv/7JJqRqqCrgitT2bYBHuOZ/i1gqV1IFIoQ200TkB nlft0EmfdtDhZ2AzW1QwpNub5gg== X-Received: by 2002:a63:b555:: with SMTP id u21mr31205060pgo.222.1566421748841; Wed, 21 Aug 2019 14:09:08 -0700 (PDT) X-Received: by 2002:a63:b555:: with SMTP id u21mr31205024pgo.222.1566421748376; Wed, 21 Aug 2019 14:09:08 -0700 (PDT) Received: from Yizhuo.cs.ucr.edu (yizhuo.cs.ucr.edu. [169.235.26.74]) by smtp.googlemail.com with ESMTPSA id m37sm4782555pjb.0.2019.08.21.14.09.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 14:09:07 -0700 (PDT) From: Yizhuo Cc: csong@cs.ucr.edu, zhiyunq@cs.ucr.edu, Yizhuo , Mike Isely , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [media] pvrusb2: qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns error code Date: Wed, 21 Aug 2019 14:09:31 -0700 Message-Id: <20190821210931.9621-1-yzhai003@ucr.edu> X-Mailer: git-send-email 2.17.1 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.17.1