From patchwork Sun May 29 10:04:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 9139837 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 2EA86607DA for ; Sun, 29 May 2016 17:41:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 226D927CF9 for ; Sun, 29 May 2016 17:41:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 174FB281FD; Sun, 29 May 2016 17:41:06 +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=ham 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 9B226281F0 for ; Sun, 29 May 2016 17:41:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030179AbcE2Rkm (ORCPT ); Sun, 29 May 2016 13:40:42 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:54984 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752807AbcE2Rkl (ORCPT ); Sun, 29 May 2016 13:40:41 -0400 Received: from ayla.of.borg ([84.195.107.21]) by baptiste.telenet-ops.be with bizsmtp id 0Hge1t00l0TjorY01HgeYK; Sun, 29 May 2016 19:40:39 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1b74ha-0006sy-7C; Sun, 29 May 2016 19:40:38 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1b6xaC-0001hV-HL; Sun, 29 May 2016 12:04:32 +0200 From: Geert Uytterhoeven To: Mauro Carvalho Chehab Cc: Arnd Bergmann , linux-media@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC] [media] dvb-usb: Initialize ret in dvb_usb_adapter_frontend_init() Date: Sun, 29 May 2016 12:04:29 +0200 Message-Id: <1464516269-6504-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.9.1 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 drivers/media/usb/dvb-usb/dvb-usb-dvb.c: In function ‘dvb_usb_adapter_frontend_init’: drivers/media/usb/dvb-usb/dvb-usb-dvb.c:323: warning: ‘ret’ is used uninitialized in this function If num_frontends is zero, dvb_usb_adapter_frontend_init() will return an uninitialized value. Initialize ret to -ENODEV to fix this. Signed-off-by: Geert Uytterhoeven --- Can num_frontends ever be zero? drivers/media/usb/dvb-usb/dvb-usb-dvb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c index 6477b04e95c748cc..2ecc7009588a25a2 100644 --- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c @@ -271,7 +271,7 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe) int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap) { - int ret, i; + int ret = -ENODEV, i; /* register all given adapter frontends */ for (i = 0; i < adap->props.num_frontends; i++) {