Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

YueHaibing and committed by
Greg Kroah-Hartman
7dd50e20 775ea4ea

+2
+2
drivers/tty/ipwireless/hardware.c
··· 1516 1516 sizeof(struct ipw_setup_get_version_query_packet), 1517 1517 ADDR_SETUP_PROT, TL_PROTOCOLID_SETUP, 1518 1518 TL_SETUP_SIGNO_GET_VERSION_QRY); 1519 + if (!ver_packet) 1520 + return; 1519 1521 ver_packet->header.length = sizeof(struct tl_setup_get_version_qry); 1520 1522 1521 1523 /*