[PATCH 2/2] [USB] [SERIAL]: fixed to skip NULL port entry in struct usb_serial_port.

Noriaki TAKAMIYA <[email protected]>
Newsgroups gmane.linux.usb.devel,gmane.linux.kernel
Message-ID <[email protected]>
Hi,

  This patch fixes to skip serial->port[i] if it is set NULL.
---
 include/linux/usb/serial.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 32acbae..85ed5ef 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -99,7 +99,10 @@ struct usb_serial_port {
 /* get and set the port private data pointer helper functions */
 static inline void *usb_get_serial_port_data (struct usb_serial_port *port)
 {
-	return dev_get_drvdata(&port->dev);
+	if (port)
+		return dev_get_drvdata(&port->dev);
+	else
+		return NULL;
 }
 
 static inline void usb_set_serial_port_data (struct usb_serial_port *port, void *data)
-- 
1.4.4

--
Noriaki TAKAMIYA

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.