From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E45303FC1 for ; Sat, 28 Aug 2021 19:30:16 +0000 (UTC) Received: by mail-ej1-f43.google.com with SMTP id mf2so21489247ejb.9 for ; Sat, 28 Aug 2021 12:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:mime-version:user-agent:subject:content-language :from:to:cc:references:in-reply-to:content-transfer-encoding; bh=+1evt0wlFoLtIOlqCJmQkkMUPdGJYqS85gEK2HrtK6Y=; b=lbKPe9hQ/2TThG38WOxsnifFkccV+Kqsn3Z44Ad9qlOdUe+htljoUc84JEaoWGyZnN PnGVYcbspdgyZ5Prd0K2uj8ZoS0cz4Y7ZSAkREymEaA6Bbni7WXwE2/02rV3eZOmxgk/ Xpv1ou6Tvv6bDaJypZnBuDhqUCr018HrvuKJfAHZP9xP0VpjE1sb5St5gVfVuYzubBxf 7Ifp4/dA54m9BoqkDaVupwhusABQFP8GNzwGgZEXb6T1gqpVBWkzHPRiVfAW1/tBIdUF cFk1PGdHEiPSUayWwJU19BHMa6UkfKZhOgdQ/RvokMNh1oREBPewWc4wfCXGYkbVCdsS DERw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=+1evt0wlFoLtIOlqCJmQkkMUPdGJYqS85gEK2HrtK6Y=; b=DL8cIsc9VGW1WvyLb+MkUCv+xXggE35xJKUCJF/g6vi4BBNFcwbDiZGe6XI9IloVFH eaR82myCGHotDw2Ekz7pJnidYdwVjvbrLeYZRSGPsGIaX+1WLM7umySAxlTCdS5UU/jj 8W+kIbOANtYAttw06d0D/oPm9WvpauTvI8aZyEeIIgDR/0bHLkVUax5i81MyBJntzX2Z fD4LnGBfUJD3FCbegvjbkFNKG4ANrrU0DU7bxppLj8jONZYBt+RzhUooOeTSGoKC9eVT 4ogvBlG9BZg2Sq45B24eqIil+8FzS11iQBAUSmYG2FW3wKndqkGwlOZV69BnFRfwMoex XxKA== X-Gm-Message-State: AOAM5338Jhp77gullbcgO160ggmFbc/K8FtYqOpbDEMbWzqdwwyuT5Mq svbdWv22q82RzjjGWI8wyx8= X-Google-Smtp-Source: ABdhPJzQT1Z4GiWLQMWKU/AtdIO8yfetOP32pxp0htvodlE8vGh1MuBMF/sK08kOjZif8heEWN7S7w== X-Received: by 2002:a17:906:e50:: with SMTP id q16mr952813eji.370.1630179015340; Sat, 28 Aug 2021 12:30:15 -0700 (PDT) Received: from ?IPV6:2a02:8108:96c0:3b88::884b? ([2a02:8108:96c0:3b88::884b]) by smtp.gmail.com with UTF8SMTPSA id s21sm3293862ejq.61.2021.08.28.12.30.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Aug 2021 12:30:14 -0700 (PDT) Message-ID: Date: Sat, 28 Aug 2021 21:30:14 +0200 Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.1 Subject: Re: [PATCH] staging: r8188eu: core: remove null check before vfree Content-Language: en-US From: Michael Straube To: Saurav Girepunje , Larry.Finger@lwfinger.net, phil@philpotter.co.uk, gregkh@linuxfoundation.org, fabioaiuto83@gmail.com, ross.schm.dev@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Cc: saurav.girepunje@hotmail.com References: <1e31610a-0324-dfb7-abe5-f05d652d461d@gmail.com> In-Reply-To: <1e31610a-0324-dfb7-abe5-f05d652d461d@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 8/28/21 21:20, Michael Straube wrote: > On 8/28/21 19:54, Saurav Girepunje wrote: >> Remove NULL check. NULL check before freeing function is not needed. >> >> Signed-off-by: Saurav Girepunje >> --- >>   drivers/staging/r8188eu/core/rtw_sta_mgt.c | 4 +--- >>   1 file changed, 1 insertion(+), 3 deletions(-) >> >> diff --git a/drivers/staging/r8188eu/core/rtw_sta_mgt.c >> b/drivers/staging/r8188eu/core/rtw_sta_mgt.c >> index f6dffed53a60..4726771a8403 100644 >> --- a/drivers/staging/r8188eu/core/rtw_sta_mgt.c >> +++ b/drivers/staging/r8188eu/core/rtw_sta_mgt.c >> @@ -155,9 +155,7 @@ u32    _rtw_free_sta_priv(struct    sta_priv >> *pstapriv) >>           spin_unlock_bh(&pstapriv->sta_hash_lock); >>           /*===============================*/ >> >> -        if (pstapriv->pallocated_stainfo_buf) >> -            vfree(pstapriv->pallocated_stainfo_buf); >> -        } >> +        vfree(pstapriv->pallocated_stainfo_buf); >> >>       return _SUCCESS; >>   } >> -- >> 2.32.0 >> > > Acked-by: Michael Straube > > Thanks, > Michael Whoops, I missed that you removed the } that belongs to the enclosing if block. Probably because it is not properly indented in the original code. Best regards, Michael