From patchwork Thu Nov 16 10:51:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10060951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8BEE8601AE for ; Thu, 16 Nov 2017 10:51:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A1762A950 for ; Thu, 16 Nov 2017 10:51:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EE5E2A95D; Thu, 16 Nov 2017 10:51:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 274E62A950 for ; Thu, 16 Nov 2017 10:51:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933819AbdKPKv2 (ORCPT ); Thu, 16 Nov 2017 05:51:28 -0500 Received: from albert.telenet-ops.be ([195.130.137.90]:54840 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933950AbdKPKvX (ORCPT ); Thu, 16 Nov 2017 05:51:23 -0500 Received: from ayla.of.borg ([84.195.106.246]) by albert.telenet-ops.be with bizsmtp id aarM1w00L5JzmfG06arMBU; Thu, 16 Nov 2017 11:51:21 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1eFHlR-0002LI-Au; Thu, 16 Nov 2017 11:51:21 +0100 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1eFHlR-0006S2-45; Thu, 16 Nov 2017 11:51:21 +0100 From: Geert Uytterhoeven To: Mauro Carvalho Chehab , Shuah Khan Cc: Arnd Bergmann , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] media: dvb_frontend: Fix uninitialized error in dvb_frontend_handle_ioctl() Date: Thu, 16 Nov 2017 11:51:20 +0100 Message-Id: <1510829480-24760-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With gcc-4.1.2: drivers/media/dvb-core/dvb_frontend.c: In function ‘dvb_frontend_handle_ioctl’: drivers/media/dvb-core/dvb_frontend.c:2110: warning: ‘err’ may be used uninitialized in this function Indeed, there are 13 cases where err is used initialized if one of the dvb_frontend_ops is not implemented. Preinitialize err to -EOPNOTSUPP like before to fix this. Fixes: d73dcf0cdb95a47f ("media: dvb_frontend: cleanup ioctl handling logic") Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann --- drivers/media/dvb-core/dvb_frontend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index 3ad83359098bde79..9eff8ce60d535379 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -2107,7 +2107,7 @@ static int dvb_frontend_handle_ioctl(struct file *file, struct dvb_frontend *fe = dvbdev->priv; struct dvb_frontend_private *fepriv = fe->frontend_priv; struct dtv_frontend_properties *c = &fe->dtv_property_cache; - int i, err; + int i, err = -ENOTSUPP; dev_dbg(fe->dvb->device, "%s:\n", __func__);