net: cdc-ncm: Move spin_lock_bh() to spin_lock()
authorYunbo Yu <yuyunbo519@gmail.com>
Mon, 18 Apr 2022 14:18:12 +0000 (22:18 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Apr 2022 09:22:16 +0000 (10:22 +0100)
It is unnecessary to call spin_lock_bh() for you are already in a tasklet.

Signed-off-by: Yunbo Yu <yuyunbo519@gmail.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/cdc_ncm.c

index 15f91d691bba35e0aad802d5d9c02158dbfc8d31..cdca00c0dc1fc6a4187b07023d252e2ff4004717 100644 (file)
@@ -1492,19 +1492,19 @@ static void cdc_ncm_txpath_bh(struct tasklet_struct *t)
        struct cdc_ncm_ctx *ctx = from_tasklet(ctx, t, bh);
        struct usbnet *dev = ctx->dev;
 
-       spin_lock_bh(&ctx->mtx);
+       spin_lock(&ctx->mtx);
        if (ctx->tx_timer_pending != 0) {
                ctx->tx_timer_pending--;
                cdc_ncm_tx_timeout_start(ctx);
-               spin_unlock_bh(&ctx->mtx);
+               spin_unlock(&ctx->mtx);
        } else if (dev->net != NULL) {
                ctx->tx_reason_timeout++;       /* count reason for transmitting */
-               spin_unlock_bh(&ctx->mtx);
+               spin_unlock(&ctx->mtx);
                netif_tx_lock_bh(dev->net);
                usbnet_start_xmit(NULL, dev->net);
                netif_tx_unlock_bh(dev->net);
        } else {
-               spin_unlock_bh(&ctx->mtx);
+               spin_unlock(&ctx->mtx);
        }
 }