From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5C82C433DF for ; Fri, 19 Jun 2020 16:46:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B521420732 for ; Fri, 19 Jun 2020 16:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592585164; bh=iYcUc5HN59kMLG7HGWR4iAb5BV2kngmF0II5snlSSQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cU07Qa5/KQfLmTLYn6HnIKfg0eEqeQ9Dxcq96/QC7VAu/EtZm0H5E4Gap8IeCnPsl Q0XB5dzUwxaMY7YYqo4HzA1tS9O5Sb/K79BHL4+BBG72vuGkF4xZB1IucfJ9s9MnXs rAAzv4xKnQdroQzPsG7P0zMl+iMdf6wImlchmYsI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388851AbgFSQp5 (ORCPT ); Fri, 19 Jun 2020 12:45:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:60410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388265AbgFSOln (ORCPT ); Fri, 19 Jun 2020 10:41:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 820D02070A; Fri, 19 Jun 2020 14:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592577703; bh=iYcUc5HN59kMLG7HGWR4iAb5BV2kngmF0II5snlSSQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KB+yJbb/6PoBuEZAvRXNLZf0+D2no1H2gTM0KXW66ZuSbq3caB1PsI/VDDXTJiw0C d71J0hQbxaI2xTfrkYRzQ4w1OmDEHGBvPHu4Rauxos+Wy+Pg08WnzoeN5GZiNYJhDP 4K3qLzrMm5p45+6GiIjvlzDAlJFNAfuKliQoDIoY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Shuah Khan , Mauro Carvalho Chehab , Florian Fainelli Subject: [PATCH 4.9 053/128] media: dvb_frontend: ensure that inital front end status initialized Date: Fri, 19 Jun 2020 16:32:27 +0200 Message-Id: <20200619141623.012586497@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141620.148019466@linuxfoundation.org> References: <20200619141620.148019466@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Colin Ian King commit a9e4998073d49a762a154a6b48a332ec6cb8e6b1 upstream. The fe_status variable s is not initialized meaning it can have any random garbage status. This could be problematic if fe->ops.tune is false as s is not updated by the call to fe->ops.tune() and a subsequent check on the change status will using a garbage value. Fix this by adding FE_NONE to the enum fe_status and initializing s to this. Detected by CoverityScan, CID#112887 ("Uninitialized scalar variable") Signed-off-by: Colin Ian King Reviewed-by: Shuah Khan Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Florian Fainelli Signed-off-by: Greg Kroah-Hartman --- drivers/media/dvb-core/dvb_frontend.c | 2 +- include/uapi/linux/dvb/frontend.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -629,7 +629,7 @@ static int dvb_frontend_thread(void *dat struct dvb_frontend *fe = data; struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dvb_frontend_private *fepriv = fe->frontend_priv; - enum fe_status s; + enum fe_status s = FE_NONE; enum dvbfe_algo algo; bool re_tune = false; bool semheld = false; --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -127,6 +127,7 @@ enum fe_sec_mini_cmd { * to reset DiSEqC, tone and parameters */ enum fe_status { + FE_NONE = 0x00, FE_HAS_SIGNAL = 0x01, FE_HAS_CARRIER = 0x02, FE_HAS_VITERBI = 0x04,