diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-04-18 22:18:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-19 13:20:41 -0400 |
commit | c33c888b585fd9ed3770e91588480a0b74e82ad0 (patch) | |
tree | 7a46c66816268c99a4fb459b9e347aa6e81bbc56 /drivers/usb | |
parent | 1cb6e73c556e8a61d41e531003cf205c16650a02 (diff) |
usbatm: fix potential NULL pointer dereference
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/atm/usbatm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index 35f10bfe15db..d3527dd8b90c 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c | |||
@@ -672,9 +672,6 @@ static int usbatm_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) | |||
672 | struct usbatm_control *ctrl = UDSL_SKB(skb); | 672 | struct usbatm_control *ctrl = UDSL_SKB(skb); |
673 | int err; | 673 | int err; |
674 | 674 | ||
675 | vdbg(&instance->usb_intf->dev, "%s called (skb 0x%p, len %u)", __func__, | ||
676 | skb, skb->len); | ||
677 | |||
678 | /* racy disconnection check - fine */ | 675 | /* racy disconnection check - fine */ |
679 | if (!instance || instance->disconnected) { | 676 | if (!instance || instance->disconnected) { |
680 | #ifdef DEBUG | 677 | #ifdef DEBUG |
@@ -684,6 +681,9 @@ static int usbatm_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) | |||
684 | goto fail; | 681 | goto fail; |
685 | } | 682 | } |
686 | 683 | ||
684 | vdbg(&instance->usb_intf->dev, "%s called (skb 0x%p, len %u)", __func__, | ||
685 | skb, skb->len); | ||
686 | |||
687 | if (vcc->qos.aal != ATM_AAL5) { | 687 | if (vcc->qos.aal != ATM_AAL5) { |
688 | atm_rldbg(instance, "%s: unsupported ATM type %d!\n", __func__, vcc->qos.aal); | 688 | atm_rldbg(instance, "%s: unsupported ATM type %d!\n", __func__, vcc->qos.aal); |
689 | err = -EINVAL; | 689 | err = -EINVAL; |