Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1372442 > unrolled thread

[PATCH] tty: ipwireless: fix possible NULL dereference

Started bySudip Mukherjee <sudipm.mukherjee@gmail.com>
First post2016-04-06 13:30 +0200
Last post2016-04-07 16:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] tty: ipwireless: fix possible NULL dereference Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-04-06 13:30 +0200
    Re: [PATCH] tty: ipwireless: fix possible NULL dereference Jiri Kosina <jikos@kernel.org> - 2016-04-07 15:50 +0200
      Re: [PATCH] tty: ipwireless: fix possible NULL dereference Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-07 16:30 +0200

#1372442 — [PATCH] tty: ipwireless: fix possible NULL dereference

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2016-04-06 13:30 +0200
Subject[PATCH] tty: ipwireless: fix possible NULL dereference
Message-ID<rkTOQ-33a-87@gated-at.bofh.it>
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>
---
 drivers/tty/ipwireless/hardware.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/tty/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c
index ad7031a..df0204b 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);
-- 
2.1.4

[toc] | [next] | [standalone]


#1373406

FromJiri Kosina <jikos@kernel.org>
Date2016-04-07 15:50 +0200
Message-ID<rlitQ-4AV-29@gated-at.bofh.it>
In reply to#1372442
On Wed, 6 Apr 2016, Sudip Mukherjee wrote:

> 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>

I don't have the git tree for this driver any more ... Greg, would you 
mind taking this through your misc driver tree?

Thanks,

-- 
Jiri Kosina
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1373427

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-04-07 16:30 +0200
Message-ID<rlj6y-5b8-19@gated-at.bofh.it>
In reply to#1373406
On Thu, Apr 07, 2016 at 03:47:54PM +0200, Jiri Kosina wrote:
> On Wed, 6 Apr 2016, Sudip Mukherjee wrote:
> 
> > 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>
> 
> I don't have the git tree for this driver any more ... Greg, would you 
> mind taking this through your misc driver tree?

Yes, I'll take it.

thanks,

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web