OSDN Git Service

hdlcdrv: replace unnecessary assertion in hdlcdrv_register
authorAditya Pakki <pakki001@umn.edu>
Tue, 17 Dec 2019 21:06:19 +0000 (15:06 -0600)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Dec 2019 01:34:20 +0000 (17:34 -0800)
In hdlcdrv_register, failure to register the driver causes a crash.
The three callers of hdlcdrv_register all pass valid pointers and
do not fail. The patch eliminates the unnecessary BUG_ON assertion.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hamradio/hdlcdrv.c

index df495b5..e7413a6 100644 (file)
@@ -687,8 +687,6 @@ struct net_device *hdlcdrv_register(const struct hdlcdrv_ops *ops,
        struct hdlcdrv_state *s;
        int err;
 
-       BUG_ON(ops == NULL);
-
        if (privsize < sizeof(struct hdlcdrv_state))
                privsize = sizeof(struct hdlcdrv_state);