Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp566581pxb; Sat, 18 Sep 2021 10:43:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYrpqU25Y6UttsMxGUutjUYG2PU2/H3cVUObubsCTAJ97BGqmaMg36Grju7Jxk4Fo6cFh/ X-Received: by 2002:a02:6d10:: with SMTP id m16mr13744493jac.60.1631987028308; Sat, 18 Sep 2021 10:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631987028; cv=none; d=google.com; s=arc-20160816; b=miI//dA68pl7Gc9o2zKwTJqBu+WH9zWPP0EOjefUAoeAlsHDrp0u4QPoS+NgGIrKE8 qf/ug7Lq40BIqhZIjLcFxAalgUYIyQRGPo9sVCCZjO0JrfmV4eX13KwLnd5NGGiqGd3v RjiMp9ZhDy58vzFPeluCslGZzYhSWMrBM+zmdtYfN5YO5xFCp3/XisAvMiQzFwr8gMsr DgmFDPcPBG/jC8VXp/9Qgw70xyfdmLM2tCpj1aTSP2X1T+wcOKIzCcOLSUS6Xd7ZwLJv Rge4Nn0LKMscm20bsPpG3Ybrr8D91IvC2W7vPZiFoKZGWDevb7AscybLLCdBlFbHmhJg zd4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=D2g+Sv3mo9b+RKB9AqcG1KSptzgJqnRsMjMqfzcV+xU=; b=K9z0sIMke38DOcOhb4bvxU861GPO9odUIfIJQV87B+UpLRkPoxpWPEG54icwsspjHq 4Wm92HmSk32Bajb9QOn9oIcb68RWKMsa4KRVNMO9GcbG1ZRSXUJ/XYPvgxdn+cSA0xME GFhd2tuBKyhIeToW6TQ7ZqHoHrAWJFSQhvaYiRbn4Sy7v/bhIlUWQ9OFfBRgxaiYTqWA hoSJeT7ylekBH3H8B0teaUpBBPcHkRKRoev7z0TNqIzByCm/fChT6zw2ZTAa1i5BuNIq e4IuJyze8VKw0GPxoSnHYWUNd+UD2BjHTd9sGk1o5ve+UJrKYthidZTq0GuWR772N0V+ BuqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZjH089Ey; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si10420099ilu.99.2021.09.18.10.43.36; Sat, 18 Sep 2021 10:43:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZjH089Ey; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238741AbhIRJtw (ORCPT + 99 others); Sat, 18 Sep 2021 05:49:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:53212 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238697AbhIRJtv (ORCPT ); Sat, 18 Sep 2021 05:49:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8056560F9C; Sat, 18 Sep 2021 09:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631958508; bh=J79zVyaYhSHXy2qTFijDe1+CyD3s14qalSH6pbbHD04=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZjH089EyKJiEY5cZLLL7rBNxGd7lmFFhUQQh7J8Mhrfb8/hU/5YpTQUkV7G0vdiCx I3RLBxFOYsxRYsndov3r5aS9hkLVjTFcMx+JfBhgL/UrFpQJxOnQtcd5EPtxtJigMJ Hc2UkudJl9S3qL9vNSxKTsCZ0CQ2IH4BjLOEY1w4= Date: Sat, 18 Sep 2021 11:48:09 +0200 From: Greg KH To: Jiapeng Chong Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: r8188eu: Remove unneeded if-null-free check Message-ID: References: <1631956206-83175-1-git-send-email-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1631956206-83175-1-git-send-email-jiapeng.chong@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 18, 2021 at 05:10:06PM +0800, Jiapeng Chong wrote: > Eliminate the following coccicheck warning: > > ./drivers/staging/r8188eu/os_dep/usb_intf.c:545:3-8: WARNING: NULL check > before some freeing functions is not needed. > > Reported-by: Abaci Robot > Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver") > Signed-off-by: Jiapeng Chong > --- > drivers/staging/r8188eu/os_dep/usb_intf.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c > index d04d2f65..7e42a0a 100644 > --- a/drivers/staging/r8188eu/os_dep/usb_intf.c > +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c > @@ -541,9 +541,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, > if (status != _SUCCESS) { > if (pnetdev) > rtw_free_netdev(pnetdev); > - else if (padapter) > - vfree(padapter); > - padapter = NULL; > + vfree(padapter); > } > exit: > return padapter; > -- > 1.8.3.1 > You just changed how this function works. :( Please be MUCH more careful, and fix your robot. greg k-h