tty: ipwireless: Fix potential NULL pointer dereference [Linux 3.16.70]

tty: ipwireless: Fix potential NULL pointer dereference [Linux 3.16.70]

This Linux kernel change "tty: ipwireless: Fix potential NULL pointer dereference" is included in the Linux 3.16.70 release. This change is authored by YueHaibing <yuehaibing [at]> on Wed Jan 30 18:30:51 2019 +0800. The commit for this change in Linux stable tree is edd9501 (patch) which is from upstream commit 7dd50e2. The same Linux upstream change may have been applied to various maintained Linux releases and you can find all Linux releases containing changes from upstream 7dd50e2.

tty: ipwireless: Fix potential NULL pointer dereference

commit 7dd50e205b3348dc7784efbdf85723551de64a25 upstream.

There is a potential NULL pointer dereference in case
alloc_ctrl_packet() fails and returns NULL.

Fixes: 099dc4fb6265 ("ipwireless: driver for PC Card 3G/UMTS modem")
Signed-off-by: YueHaibing <>
Signed-off-by: Greg Kroah-Hartman <>
Signed-off-by: Ben Hutchings <>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/tty/ipwireless/hardware.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/tty/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c
index 2c14842..9d15fb5 100644
--- a/drivers/tty/ipwireless/hardware.c
+++ b/drivers/tty/ipwireless/hardware.c
@@ -1515,6 +1515,8 @@ static void ipw_send_setup_packet(struct ipw_hardware *hw)
            sizeof(struct ipw_setup_get_version_query_packet),
+   if (!ver_packet)
+       return;
    ver_packet->header.length = sizeof(struct tl_setup_get_version_qry);


Leave a Reply

Your email address will not be published. Required fields are marked *