From patchwork Tue Nov 19 13:49:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 3202051 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1B554C045B for ; Tue, 19 Nov 2013 13:57:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01D12201F4 for ; Tue, 19 Nov 2013 13:57:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D71CD201E9 for ; Tue, 19 Nov 2013 13:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752525Ab3KSN5j (ORCPT ); Tue, 19 Nov 2013 08:57:39 -0500 Received: from etezian.org ([198.101.225.253]:58645 "EHLO mail.etezian.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752447Ab3KSN5i (ORCPT ); Tue, 19 Nov 2013 08:57:38 -0500 X-Greylist: delayed 469 seconds by postgrey-1.27 at vger.kernel.org; Tue, 19 Nov 2013 08:57:38 EST Received: from mail.etezian.org (unknown [131.228.216.129]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail.etezian.org (Postfix) with ESMTPSA id 0251518358; Tue, 19 Nov 2013 07:53:25 -0600 (CST) From: Andi Shyti To: m.chehab@samsung.com, mkrufky@linuxtv.org, ljalvs@gmail.com, crope@iki.fi Cc: andi@etezian.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: cx24117: remove dead code in always 'false' if statement Date: Tue, 19 Nov 2013 14:49:37 +0100 Message-Id: <1384868977-24211-1-git-send-email-andi@etezian.org> X-Mailer: git-send-email 1.8.4.3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP At this point of the execution in the function cx24117_attach() demod cannot be '0'. In that case the function returns earlier with an error value ('NULL'). Remove the if statement. This error has been reported by scan.coverity.com Signed-off-by: Andi Shyti --- drivers/media/dvb-frontends/cx24117.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/media/dvb-frontends/cx24117.c b/drivers/media/dvb-frontends/cx24117.c index 476b422..07a9894 100644 --- a/drivers/media/dvb-frontends/cx24117.c +++ b/drivers/media/dvb-frontends/cx24117.c @@ -1190,12 +1190,6 @@ struct dvb_frontend *cx24117_attach(const struct cx24117_config *config, state->demod = demod - 1; state->priv = priv; - /* test i2c bus for ack */ - if (demod == 0) { - if (cx24117_readreg(state, 0x00) < 0) - goto error3; - } - dev_info(&state->priv->i2c->dev, "%s: Attaching frontend %d\n", KBUILD_MODNAME, state->demod); @@ -1206,8 +1200,6 @@ struct dvb_frontend *cx24117_attach(const struct cx24117_config *config, state->frontend.demodulator_priv = state; return &state->frontend; -error3: - kfree(state); error2: cx24117_release_priv(priv); error1: