]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
tty: ipwireless: Fix potential NULL pointer dereference
authorYueHaibing <yuehaibing@huawei.com>
Wed, 30 Jan 2019 10:30:51 +0000 (18:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Jan 2019 11:03:58 +0000 (12:03 +0100)
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>
drivers/tty/ipwireless/hardware.c

index b0baa4ce10f9897d5f2284c7aa6e50c6dd5bb7de..6bbf35682d5310cd1226410b4fdf91dfff1ae67a 100644 (file)
@@ -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);
 
        /*