Skip to content

Commit

Permalink
usbatm: fix potential NULL pointer dereference
Browse files Browse the repository at this point in the history
The dereference to 'instance' in the debug code should be moved
below the NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Apr 19, 2013
1 parent 1cb6e73 commit c33c888
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/usb/atm/usbatm.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,6 @@ static int usbatm_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
struct usbatm_control *ctrl = UDSL_SKB(skb);
int err;

vdbg(&instance->usb_intf->dev, "%s called (skb 0x%p, len %u)", __func__,
skb, skb->len);

/* racy disconnection check - fine */
if (!instance || instance->disconnected) {
#ifdef DEBUG
Expand All @@ -684,6 +681,9 @@ static int usbatm_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
goto fail;
}

vdbg(&instance->usb_intf->dev, "%s called (skb 0x%p, len %u)", __func__,
skb, skb->len);

if (vcc->qos.aal != ATM_AAL5) {
atm_rldbg(instance, "%s: unsupported ATM type %d!\n", __func__, vcc->qos.aal);
err = -EINVAL;
Expand Down

0 comments on commit c33c888

Please sign in to comment.