1 From 2203718c2f59ffdd6c78d54e5add594aebb4461e Mon Sep 17 00:00:00 2001
2 From: Georgi Valkov <gvalkov@gmail.com>
3 Date: Wed, 7 Jun 2023 15:56:59 +0200
4 Subject: [PATCH 1/4] usbnet: ipheth: fix risk of NULL pointer deallocation
6 The cleanup precedure in ipheth_probe will attempt to free a
7 NULL pointer in dev->ctrl_buf if the memory allocation for
8 this buffer is not successful. While kfree ignores NULL pointers,
9 and the existing code is safe, it is a better design to rearrange
10 the goto labels and avoid this.
12 Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
13 Signed-off-by: Foster Snowhill <forst@pen.gy>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
16 drivers/net/usb/ipheth.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
19 --- a/drivers/net/usb/ipheth.c
20 +++ b/drivers/net/usb/ipheth.c
21 @@ -510,8 +510,8 @@ err_register_netdev:
22 ipheth_free_urbs(dev);