[PATCH v2] hdlcdrv: replace unnecessary assertion in hdlcdrv_register

From: Aditya Pakki
Date: Tue Dec 17 2019 - 16:06:26 EST


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@xxxxxxx>
---
v1: Changed from returning -EINVAL to deleting BUG_ON as identified
by Stephen Hemminger.
---
drivers/net/hamradio/hdlcdrv.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
index df495b5595f5..e7413a643929 100644
--- a/drivers/net/hamradio/hdlcdrv.c
+++ b/drivers/net/hamradio/hdlcdrv.c
@@ -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);

--
2.20.1