Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15472
b: refs/heads/master
c: 487f9c6
h: refs/heads/master
v: v3
  • Loading branch information
Luiz Fernando Capitulino authored and Greg Kroah-Hartman committed Jan 4, 2006
1 parent 31fe474 commit c520e4e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 717f736d937d0e98e964375dac770bfa20f73b72
refs/heads/master: 487f9c6710e7dff338e59820f6cfaeaaa87cb532
32 changes: 32 additions & 0 deletions trunk/drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ static int serial_open (struct tty_struct *tty, struct file * filp)

portNumber = tty->index - serial->minor;
port = serial->port[portNumber];
if (!port)
return -ENODEV;

++port->open_count;

Expand Down Expand Up @@ -258,6 +260,9 @@ static int serial_write (struct tty_struct * tty, const unsigned char *buf, int
struct usb_serial_port *port = tty->driver_data;
int retval = -EINVAL;

if (!port)
goto exit;

dbg("%s - port %d, %d byte(s)", __FUNCTION__, port->number, count);

if (!port->open_count) {
Expand All @@ -277,6 +282,9 @@ static int serial_write_room (struct tty_struct *tty)
struct usb_serial_port *port = tty->driver_data;
int retval = -EINVAL;

if (!port)
goto exit;

dbg("%s - port %d", __FUNCTION__, port->number);

if (!port->open_count) {
Expand All @@ -296,6 +304,9 @@ static int serial_chars_in_buffer (struct tty_struct *tty)
struct usb_serial_port *port = tty->driver_data;
int retval = -EINVAL;

if (!port)
goto exit;

dbg("%s = port %d", __FUNCTION__, port->number);

if (!port->open_count) {
Expand All @@ -314,6 +325,9 @@ static void serial_throttle (struct tty_struct * tty)
{
struct usb_serial_port *port = tty->driver_data;

if (!port)
return;

dbg("%s - port %d", __FUNCTION__, port->number);

if (!port->open_count) {
Expand All @@ -330,6 +344,9 @@ static void serial_unthrottle (struct tty_struct * tty)
{
struct usb_serial_port *port = tty->driver_data;

if (!port)
return;

dbg("%s - port %d", __FUNCTION__, port->number);

if (!port->open_count) {
Expand All @@ -347,6 +364,9 @@ static int serial_ioctl (struct tty_struct *tty, struct file * file, unsigned in
struct usb_serial_port *port = tty->driver_data;
int retval = -ENODEV;

if (!port)
goto exit;

dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd);

if (!port->open_count) {
Expand All @@ -368,6 +388,9 @@ static void serial_set_termios (struct tty_struct *tty, struct termios * old)
{
struct usb_serial_port *port = tty->driver_data;

if (!port)
return;

dbg("%s - port %d", __FUNCTION__, port->number);

if (!port->open_count) {
Expand All @@ -384,6 +407,9 @@ static void serial_break (struct tty_struct *tty, int break_state)
{
struct usb_serial_port *port = tty->driver_data;

if (!port)
return;

dbg("%s - port %d", __FUNCTION__, port->number);

if (!port->open_count) {
Expand Down Expand Up @@ -445,6 +471,9 @@ static int serial_tiocmget (struct tty_struct *tty, struct file *file)
{
struct usb_serial_port *port = tty->driver_data;

if (!port)
goto exit;

dbg("%s - port %d", __FUNCTION__, port->number);

if (!port->open_count) {
Expand All @@ -464,6 +493,9 @@ static int serial_tiocmset (struct tty_struct *tty, struct file *file,
{
struct usb_serial_port *port = tty->driver_data;

if (!port)
goto exit;

dbg("%s - port %d", __FUNCTION__, port->number);

if (!port->open_count) {
Expand Down

0 comments on commit c520e4e

Please sign in to comment.