Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: misc: Remove unnecessary NULL values

The NULL initialization of the pointers assigned by kzalloc() first is
not necessary, because if the kzalloc() failed, the pointers will be
assigned NULL, otherwise it works as usual. so remove it.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230804093253.91647-3-ruanjinjie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ruan Jinjie and committed by
Greg Kroah-Hartman
f87ba66a 3024faf7

+3 -3
+1 -1
drivers/usb/misc/cypress_cy7c63.c
··· 203 203 static int cypress_probe(struct usb_interface *interface, 204 204 const struct usb_device_id *id) 205 205 { 206 - struct cypress *dev = NULL; 206 + struct cypress *dev; 207 207 int retval = -ENOMEM; 208 208 209 209 /* allocate memory for our device state and initialize it */
+1 -1
drivers/usb/misc/cytherm.c
··· 304 304 const struct usb_device_id *id) 305 305 { 306 306 struct usb_device *udev = interface_to_usbdev(interface); 307 - struct usb_cytherm *dev = NULL; 307 + struct usb_cytherm *dev; 308 308 int retval = -ENOMEM; 309 309 310 310 dev = kzalloc(sizeof(struct usb_cytherm), GFP_KERNEL);
+1 -1
drivers/usb/misc/usbsevseg.c
··· 305 305 const struct usb_device_id *id) 306 306 { 307 307 struct usb_device *udev = interface_to_usbdev(interface); 308 - struct usb_sevsegdev *mydev = NULL; 308 + struct usb_sevsegdev *mydev; 309 309 int rc = -ENOMEM; 310 310 311 311 mydev = kzalloc(sizeof(struct usb_sevsegdev), GFP_KERNEL);