lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210311150354.8723-1-lyl2019@mail.ustc.edu.cn>
Date:   Thu, 11 Mar 2021 07:03:54 -0800
From:   Lv Yunlong <lyl2019@...l.ustc.edu.cn>
To:     gregkh@...uxfoundation.org
Cc:     linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        Lv Yunlong <lyl2019@...l.ustc.edu.cn>
Subject: [PATCH] usb/usbtmc: Remove a redundant kref_put in usbtmc_disconnect

In the implementation of usbtmc_free_int(), it already calls
kref_put() to free the data as shown below. So, in
usbtmc_disconnect, call an extra kref_put() is redundant.

"""
static void usbtmc_free_int(struct usbtmc_device_data *data)
{
	if (!data->iin_ep_present || !data->iin_urb)
		return;
	usb_kill_urb(data->iin_urb);
	kfree(data->iin_buffer);
	data->iin_buffer = NULL;
	usb_free_urb(data->iin_urb);
	data->iin_urb = NULL;
	kref_put(&data->kref, usbtmc_delete);
}
"""

Signed-off-by: Lv Yunlong <lyl2019@...l.ustc.edu.cn>
---
 drivers/usb/class/usbtmc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 74d5a9c5238a..adcdd2df1949 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -2494,7 +2494,6 @@ static void usbtmc_disconnect(struct usb_interface *intf)
 	}
 	mutex_unlock(&data->io_mutex);
 	usbtmc_free_int(data);
-	kref_put(&data->kref, usbtmc_delete);
 }
 
 static void usbtmc_draw_down(struct usbtmc_file_data *file_data)
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ