summaryrefslogtreecommitdiffstats
path: root/drivers/tty/ipwireless/hardware.c
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-01-30 11:30:51 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-30 12:03:58 +0100
commit7dd50e205b3348dc7784efbdf85723551de64a25 (patch)
treef26906aae84b94d82a1e1a785478ab0ca6655f14 /drivers/tty/ipwireless/hardware.c
parentserial: mps2-uart: support combined irq (diff)
downloadlinux-7dd50e205b3348dc7784efbdf85723551de64a25.tar.xz
linux-7dd50e205b3348dc7784efbdf85723551de64a25.zip
tty: ipwireless: Fix potential NULL pointer dereference
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 <yuehaibing@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/ipwireless/hardware.c')
-rw-r--r--drivers/tty/ipwireless/hardware.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c
index b0baa4ce10f9..6bbf35682d53 100644
--- a/drivers/tty/ipwireless/hardware.c
+++ b/drivers/tty/ipwireless/hardware.c
@@ -1516,6 +1516,8 @@ static void ipw_send_setup_packet(struct ipw_hardware *hw)
sizeof(struct ipw_setup_get_version_query_packet),
ADDR_SETUP_PROT, TL_PROTOCOLID_SETUP,
TL_SETUP_SIGNO_GET_VERSION_QRY);
+ if (!ver_packet)
+ return;
ver_packet->header.length = sizeof(struct tl_setup_get_version_qry);
/*