[Linux-kernel-mentees] [PATCH] net: usb: rtl8150: don't incorrectly assign random MAC addresses

Jakub Kicinski kuba at kernel.org
Sat Oct 10 16:59:31 UTC 2020


On Sat, 10 Oct 2020 12:14:59 +0530 Anant Thazhemadam wrote:
> get_registers() directly returns the return value of
> usb_control_msg_recv() - 0 if successful, and negative error number 
> otherwise.

Are you expecting Greg to take this as a part of some USB subsystem
changes? I don't see usb_control_msg_recv() in my tree, and the
semantics of usb_control_msg() are not what you described.

> However, in set_ethernet_addr(), this return value is incorrectly 
> checked.
> 
> Since this return value will never be equal to sizeof(node_id), a 
> random MAC address will always be generated and assigned to the 
> device; even in cases when get_registers() is successful.
> 
> Correctly modifying the condition that checks if get_registers() was 
> successful or not fixes this problem, and copies the ethernet address
> appropriately.
> 
> Fixes: f45a4248ea4c ("set random MAC address when set_ethernet_addr() fails")
> Signed-off-by: Anant Thazhemadam <anant.thazhemadam at gmail.com>

The fixes tag does not follow the standard format:

Fixes tag: Fixes: f45a4248ea4c ("set random MAC address when set_ethernet_addr() fails")
Has these problem(s):
	- Subject does not match target commit subject
	  Just use
		git log -1 --format='Fixes: %h ("%s")'


Please put the relevant maintainer in the To: field of the email, and
even better - also mark the patch as [PATCH net], since it's a
networking fix.


More information about the Linux-kernel-mentees mailing list