2004-09-27 17:52:59

by Luiz Fernando Capitulino

[permalink] [raw]
Subject: [PATCH 2/5]: usb-serial: create_serial() return value trivial fix.


create_serial() only returns NULL if there is no memory enough
to a new `usb_serial' structure, thus, the right error code to
return is -ENOMEM.

(against 2.6.9-rc2-mm4)


Signed-off-by: Luiz Capitulino <[email protected]>

drivers/usb/serial/usb-serial.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)


diff -X /home/lcapitulino/kernels/2.6/dontdiff -Nparu a/drivers/usb/serial/usb-serial.c a~/drivers/usb/serial/usb-serial.c
--- a/drivers/usb/serial/usb-serial.c 2004-09-26 13:13:21.000000000 -0300
+++ a~/drivers/usb/serial/usb-serial.c 2004-09-26 13:14:09.000000000 -0300
@@ -896,7 +896,7 @@ int usb_serial_probe(struct usb_interfac
serial = create_serial (dev, interface, type);
if (!serial) {
dev_err(&interface->dev, "%s - out of memory\n", __FUNCTION__);
- return -ENODEV;
+ return -ENOMEM;
}

/* if this device type has a probe function, call it */