From patchwork Sat Nov 22 18:29:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 5359691 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 50EA09F2ED for ; Sat, 22 Nov 2014 18:28:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B87B20145 for ; Sat, 22 Nov 2014 18:28:05 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 686EF20115 for ; Sat, 22 Nov 2014 18:28:04 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8C7C52614FD; Sat, 22 Nov 2014 19:28:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 862E72614F4; Sat, 22 Nov 2014 19:27:54 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 30872261507; Sat, 22 Nov 2014 19:27:53 +0100 (CET) Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by alsa0.perex.cz (Postfix) with ESMTP id 82AEB2614F6 for ; Sat, 22 Nov 2014 19:27:41 +0100 (CET) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sAMIRaqe020974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 22 Nov 2014 18:27:39 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sAMIRWNm027797 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 22 Nov 2014 18:27:33 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sAMIRV1B018212; Sat, 22 Nov 2014 18:27:31 GMT Received: from mwanda (/197.157.0.4) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 22 Nov 2014 10:27:31 -0800 Date: Sat, 22 Nov 2014 21:29:01 +0300 From: Dan Carpenter To: Jaroslav Kysela Message-ID: <20141122182901.GA6994@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet21.oracle.com [141.146.126.237] Cc: Takashi Iwai , kernel-janitors@vger.kernel.org, alsa-devel@alsa-project.org, Himangi Saraogi Subject: [alsa-devel] [patch] sound: oss: uart401: remove unneeded NULL check X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP "devc" can't be NULL here so there is no need to check. Also I removed the "devc = NULL" assignment because devc is stored on stack so it's a no-op. Signed-off-by: Dan Carpenter diff --git a/sound/oss/uart401.c b/sound/oss/uart401.c index 279bc56..dae4d43 100644 --- a/sound/oss/uart401.c +++ b/sound/oss/uart401.c @@ -412,13 +412,10 @@ void unload_uart401(struct address_info *hw_config) if (!devc->share_irq) free_irq(devc->irq, devc); - if (devc) - { - kfree(midi_devs[devc->my_dev]->converter); - kfree(midi_devs[devc->my_dev]); - kfree(devc); - devc = NULL; - } + kfree(midi_devs[devc->my_dev]->converter); + kfree(midi_devs[devc->my_dev]); + kfree(devc); + /* This kills midi_devs[x] */ sound_unload_mididev(hw_config->slots[4]); }