linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: rtl8xxxu: Simplify the error handling code
@ 2022-08-18  7:33 Zheyu Ma
  2022-09-07  8:01 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Zheyu Ma @ 2022-08-18  7:33 UTC (permalink / raw)
  To: Jes Sorensen, Kalle Valo, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: Zheyu Ma, kernel test robot, Dan Carpenter, linux-wireless,
	netdev, linux-kernel

Since the logic of the driver's error handling code has changed, the
previous dead store and checks are not needed.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index c66f0726b253..e97e35b39225 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -6657,7 +6657,6 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 	hw = ieee80211_alloc_hw(sizeof(struct rtl8xxxu_priv), &rtl8xxxu_ops);
 	if (!hw) {
 		ret = -ENOMEM;
-		priv = NULL;
 		goto err_put_dev;
 	}
 
@@ -6768,11 +6767,9 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 err_set_intfdata:
 	usb_set_intfdata(interface, NULL);
 
-	if (priv) {
-		kfree(priv->fw_data);
-		mutex_destroy(&priv->usb_buf_mutex);
-		mutex_destroy(&priv->h2c_mutex);
-	}
+	kfree(priv->fw_data);
+	mutex_destroy(&priv->usb_buf_mutex);
+	mutex_destroy(&priv->h2c_mutex);
 
 	ieee80211_free_hw(hw);
 err_put_dev:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wifi: rtl8xxxu: Simplify the error handling code
  2022-08-18  7:33 [PATCH] wifi: rtl8xxxu: Simplify the error handling code Zheyu Ma
@ 2022-09-07  8:01 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2022-09-07  8:01 UTC (permalink / raw)
  To: Zheyu Ma
  Cc: Jes Sorensen, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Zheyu Ma, kernel test robot, Dan Carpenter,
	linux-wireless, netdev, linux-kernel

Zheyu Ma <zheyuma97@gmail.com> wrote:

> Since the logic of the driver's error handling code has changed, the
> previous dead store and checks are not needed.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>

Patch applied to wireless-next.git, thanks.

98d3f063be78 wifi: rtl8xxxu: Simplify the error handling code

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20220818073352.3156288-1-zheyuma97@gmail.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-07  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18  7:33 [PATCH] wifi: rtl8xxxu: Simplify the error handling code Zheyu Ma
2022-09-07  8:01 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).