Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1480550iog; Tue, 14 Jun 2022 06:59:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQaJpYRCMna/DWzp73b5hJTgJAn8JKESi9/W5NHkAB9gY6qHbfHl46pSwtvIBGoJpolPng X-Received: by 2002:a17:906:51d5:b0:711:f4c7:5085 with SMTP id v21-20020a17090651d500b00711f4c75085mr4648209ejk.650.1655215178356; Tue, 14 Jun 2022 06:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655215178; cv=none; d=google.com; s=arc-20160816; b=ZJZqfdDa4M2L495qz+9v8xmlPNM8DmIRVb7THBCARdd0aYCU28QxDoKwsTWGW1xnPJ BZdtpHM7caOUVHLRER+R153ZoWNuEC3nmnJ/N5vq3yoPryoCYRBbnZCEfjJ7f00cnF2j WGaj97//VD8k6bO/WMVVX0gVUi7Vuowl0YQIQkRyb0n3oymhbaeJ8DvAjvGeGaDlRLkO WM234X1XLxEVLXgfhHQ+Ma5sr5ZbZGi3kIR6O3RwrxNiWs1tN9fe5/ex3M5riHkWQ4oK mJv3sUUZMH4SDtTtTIQkkE7QlWubS4+VJn7ducOJg9EeCmm++0jfKDaFFy2JcMbqrvfR gPow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=N2SVhsksiRzjmkv+x4hWBA4t6g3sEnvLlcY4Jo8VnzY=; b=x9xoVjaOgOmP54A/HOVFtu1L1UCBJkchoB3SF8zXzW/Yvng3ZJtSJ8NNW3nWlTyJOC hEPMiXtRj7PDJdhkrl3quG3urThUYXtJhra8vf3S2ds/zx+0s6pjy/zoKiL1xX2wcvk5 VYhxRqQ/G10KlkPa6yNrlwPr2P+1QvafLlNIQTPkW9vAbh5R4mXCPKxVV4BxPmerlUHe uWdtsd4uX2moDdvXX37TGoAC+7rAHh1FKqjscOtdFRf83Ah/XNNvbjw0k+h4O5QCwnkL gjylDTBpVqZYTxtkQ878wUnIFuooXk8Cow4wD8hXz5Hl8glHjrGMCF+DpgbTuwBd48eK YfrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p10-20020a170906604a00b007107e8746casi10688001ejj.519.2022.06.14.06.59.12; Tue, 14 Jun 2022 06:59:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244456AbiFNNer (ORCPT + 99 others); Tue, 14 Jun 2022 09:34:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243308AbiFNNeo (ORCPT ); Tue, 14 Jun 2022 09:34:44 -0400 Received: from hust.edu.cn (unknown [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE5C41C11F for ; Tue, 14 Jun 2022 06:34:43 -0700 (PDT) Received: from localhost.localdomain ([172.16.0.254]) (user=dzm91@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 25EDWoU6010890-25EDWoU9010890 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 14 Jun 2022 21:32:54 +0800 From: Dongliang Mu To: Larry Finger , Phillip Potter , Greg Kroah-Hartman , Martin Kaiser , Michael Straube , Pavel Skripkin Cc: Dongliang Mu , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2] driver: r8188eu: remove NULL check before vfree Date: Tue, 14 Jun 2022 21:32:29 +0800 Message-Id: <20220614133239.147076-1-dzm91@hust.edu.cn> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: dzm91@hust.edu.cn X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dongliang Mu vfree can handle NULL pointer as its argument. According to coccinelle isnullfree check, remove NULL check before vfree operation. Signed-off-by: Dongliang Mu --- v1->v2: fix the logic change in the patch v1 drivers/staging/r8188eu/os_dep/usb_intf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c index 68869c5daeff..cc2b44f60c46 100644 --- a/drivers/staging/r8188eu/os_dep/usb_intf.c +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c @@ -372,7 +372,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, free_adapter: if (pnetdev) rtw_free_netdev(pnetdev); - else if (padapter) + else vfree(padapter); return NULL; -- 2.35.1