From patchwork Thu Feb 4 09:15:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glen Lee X-Patchwork-Id: 8215431 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 252A49F3CD for ; Thu, 4 Feb 2016 09:30:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56DBB20373 for ; Thu, 4 Feb 2016 09:30:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A64820172 for ; Thu, 4 Feb 2016 09:30:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965890AbcBDJZu (ORCPT ); Thu, 4 Feb 2016 04:25:50 -0500 Received: from eusmtp01.atmel.com ([212.144.249.243]:9900 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965764AbcBDJZP (ORCPT ); Thu, 4 Feb 2016 04:25:15 -0500 Received: from glen-ubuntu.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.3.235.1; Thu, 4 Feb 2016 10:25:08 +0100 From: Glen Lee To: CC: , , , , , , , , Subject: [PATCH RESEND 23/70] staging: wilc1000: fixes variable dereferenced before check Date: Thu, 4 Feb 2016 18:15:40 +0900 Message-ID: <1454577387-509-24-git-send-email-glen.lee@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454577387-509-1-git-send-email-glen.lee@atmel.com> References: <1454577387-509-1-git-send-email-glen.lee@atmel.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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=unavailable 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 From: Leo Kim This patch fixes the warning reported by smatch. - wilc_wlan_get_firmware() warn: variable dereferenced before check 'vif' - wilc_set_multicast_list() warn: variable dereferenced before check 'dev' Just delete them and no need add null check since they are net_device from ndo_set_rx_mode of net_device_ops and vif of netdev_priv. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 9ca33536..22a2f98 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -397,9 +397,6 @@ int wilc_wlan_get_firmware(struct net_device *dev) netdev_info(dev, "loading firmware %s\n", firmware); - if (!vif) - goto _fail_; - if (!(&vif->ndev->dev)) goto _fail_; @@ -1017,9 +1014,6 @@ static void wilc_set_multicast_list(struct net_device *dev) vif = netdev_priv(dev); hif_drv = (struct host_if_drv *)priv->hif_drv; - if (!dev) - return; - if (dev->flags & IFF_PROMISC) return;