aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2016-04-06 12:25:39 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-30 09:26:55 -0700
commit76bbdcb35ebb0e9c5315c4b249cd883cca9e065d (patch)
tree6d9210f89bb437f0cbb7400f4972731451c06f7e /drivers/tty
parentserial: 8250: Remove unused define (diff)
downloadlinux-dev-76bbdcb35ebb0e9c5315c4b249cd883cca9e065d.tar.xz
linux-dev-76bbdcb35ebb0e9c5315c4b249cd883cca9e065d.zip
tty: ipwireless: fix possible NULL dereference
The function alloc_ctrl_packet() can fail and return NULL. Incase it fails print an error message and exit. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Reviewed-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/ipwireless/hardware.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c
index ad7031a4f3c4..df0204b6148f 100644
--- a/drivers/tty/ipwireless/hardware.c
+++ b/drivers/tty/ipwireless/hardware.c
@@ -1572,6 +1572,11 @@ static void handle_received_SETUP_packet(struct ipw_hardware *hw,
sizeof(struct ipw_setup_reboot_msg_ack),
ADDR_SETUP_PROT, TL_PROTOCOLID_SETUP,
TL_SETUP_SIGNO_REBOOT_MSG_ACK);
+ if (!packet) {
+ pr_err(IPWIRELESS_PCCARD_NAME
+ ": Not enough memory to send reboot packet");
+ break;
+ }
packet->header.length =
sizeof(struct TlSetupRebootMsgAck);
send_packet(hw, PRIO_SETUP, &packet->header);