Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c33c888b authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman
Browse files

usbatm: fix potential NULL pointer dereference



The dereference to 'instance' in the debug code should be moved
below the NULL test.

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarDuncan Sands <baldrick@free.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1cb6e73c
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -672,9 +672,6 @@ static int usbatm_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
	struct usbatm_control *ctrl = UDSL_SKB(skb);
	struct usbatm_control *ctrl = UDSL_SKB(skb);
	int err;
	int err;


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

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


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

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