LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Noriaki TAKAMIYA <takamiya@linux-ipv6.org>
To: linux-usb-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, usagi-core@linux-ipv6.org
Subject: [PATCH 2/2] [USB] [SERIAL]: fixed to skip NULL port entry in struct usb_serial_port.
Date: Sun, 25 Mar 2007 00:55:07 +0900 (JST)	[thread overview]
Message-ID: <20070325.005507.424245753.takamiya@linux-ipv6.org> (raw)
In-Reply-To: <20070325.005227.432838064.takamiya@linux-ipv6.org>

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

  parent reply	other threads:[~2007-03-24 15:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-24 15:52 [PATCH 0/2] [SERIAL] [USB] fixed to skip NULL entry in struct serial usb_serial_port Noriaki TAKAMIYA
2007-03-24 15:54 ` [PATCH 1/2] [USB] [PL2303]: fixed to skip NULL entry in pl2303_shutdown Noriaki TAKAMIYA
2007-03-24 15:56   ` (usagi-core 32633) " Noriaki TAKAMIYA
2007-03-24 16:01   ` Noriaki TAKAMIYA
2007-03-24 15:55 ` Noriaki TAKAMIYA [this message]
2007-03-24 15:57   ` (usagi-core 32634) [PATCH 2/2] [USB] [SERIAL]: fixed to skip NULL port entry in struct usb_serial_port Noriaki TAKAMIYA
2007-03-24 21:22 ` [linux-usb-devel] [PATCH 0/2] [SERIAL] [USB] fixed to skip NULL entry in struct serial usb_serial_port Greg KH
2007-03-25  5:47   ` (usagi-core 32638) " Noriaki TAKAMIYA
2007-03-25 15:55     ` Greg KH
2007-03-26  0:38       ` (usagi-core 32640) " Noriaki TAKAMIYA
2007-03-27 22:51         ` Greg KH
2007-03-28  1:36           ` (usagi-core 32652) " Noriaki TAKAMIYA

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070325.005507.424245753.takamiya@linux-ipv6.org \
    --to=takamiya@linux-ipv6.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=usagi-core@linux-ipv6.org \
    --subject='Re: [PATCH 2/2] [USB] [SERIAL]: fixed to skip NULL port entry in struct usb_serial_port.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).