提交 76bbdcb3 编写于 作者: S Sudip Mukherjee 提交者: Greg Kroah-Hartman

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: NSudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Reviewed-by: NJiri Kosina <jkosina@suse.cz>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9c589505
...@@ -1572,6 +1572,11 @@ static void handle_received_SETUP_packet(struct ipw_hardware *hw, ...@@ -1572,6 +1572,11 @@ static void handle_received_SETUP_packet(struct ipw_hardware *hw,
sizeof(struct ipw_setup_reboot_msg_ack), sizeof(struct ipw_setup_reboot_msg_ack),
ADDR_SETUP_PROT, TL_PROTOCOLID_SETUP, ADDR_SETUP_PROT, TL_PROTOCOLID_SETUP,
TL_SETUP_SIGNO_REBOOT_MSG_ACK); TL_SETUP_SIGNO_REBOOT_MSG_ACK);
if (!packet) {
pr_err(IPWIRELESS_PCCARD_NAME
": Not enough memory to send reboot packet");
break;
}
packet->header.length = packet->header.length =
sizeof(struct TlSetupRebootMsgAck); sizeof(struct TlSetupRebootMsgAck);
send_packet(hw, PRIO_SETUP, &packet->header); send_packet(hw, PRIO_SETUP, &packet->header);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册