lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 15 Dec 2019 11:58:41 -0600
From:   Aditya Pakki <>
Cc:, "David S. Miller" <>,
        Greg Kroah-Hartman <>,
        Markus Elfring <>,
        Richard Fontana <>,
        Thomas Gleixner <>,,
Subject: [PATCH] hdlcdrv: replace assertion with recovery code

In hdlcdrv_register, failure to register the driver causes a crash.
However, by returning the error to the caller in case ops is NULL
can avoid the crash. The patch fixes this issue.

Signed-off-by: Aditya Pakki <>
 drivers/net/hamradio/hdlcdrv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
index df495b5595f5..38e5d1e54800 100644
--- a/drivers/net/hamradio/hdlcdrv.c
+++ b/drivers/net/hamradio/hdlcdrv.c
@@ -687,7 +687,8 @@ struct net_device *hdlcdrv_register(const struct hdlcdrv_ops *ops,
 	struct hdlcdrv_state *s;
 	int err;
-	BUG_ON(ops == NULL);
+	if (!ops)
+		return ERR_PTR(-EINVAL);
 	if (privsize < sizeof(struct hdlcdrv_state))
 		privsize = sizeof(struct hdlcdrv_state);

Powered by blists - more mailing lists