mirror of https://gitee.com/openkylin/linux.git
staging: ozwpan: Fixes crash due to invalid port aceess.
This patch fixes kernel crash issue, when we receive URB request after de-enumerating device. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b2271b5bdf
commit
bc9aece00a
|
@ -480,10 +480,14 @@ static int oz_enqueue_ep_urb(struct oz_port *port, u8 ep_addr, int in_dir,
|
||||||
oz_free_urb_link(urbl);
|
oz_free_urb_link(urbl);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (in_dir)
|
if (in_dir && port->in_ep[ep_addr])
|
||||||
ep = port->in_ep[ep_addr];
|
ep = port->in_ep[ep_addr];
|
||||||
else
|
else if (!in_dir && port->out_ep[ep_addr])
|
||||||
ep = port->out_ep[ep_addr];
|
ep = port->out_ep[ep_addr];
|
||||||
|
else {
|
||||||
|
err = -ENOMEM;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
/*For interrupt endpoint check for buffered data
|
/*For interrupt endpoint check for buffered data
|
||||||
* & complete urb
|
* & complete urb
|
||||||
|
@ -505,6 +509,7 @@ static int oz_enqueue_ep_urb(struct oz_port *port, u8 ep_addr, int in_dir,
|
||||||
} else {
|
} else {
|
||||||
err = -EPIPE;
|
err = -EPIPE;
|
||||||
}
|
}
|
||||||
|
out:
|
||||||
spin_unlock_bh(&port->ozhcd->hcd_lock);
|
spin_unlock_bh(&port->ozhcd->hcd_lock);
|
||||||
if (err)
|
if (err)
|
||||||
oz_free_urb_link(urbl);
|
oz_free_urb_link(urbl);
|
||||||
|
|
Loading…
Reference in New Issue