public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tty: ipwireless: fix possible NULL dereference
@ 2016-04-06 11:25 Sudip Mukherjee
  2016-04-07 13:47 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Sudip Mukherjee @ 2016-04-06 11:25 UTC (permalink / raw)
  To: Jiri Kosina, David Sterba, Greg Kroah-Hartman, Jiri Slaby
  Cc: linux-kernel, Sudip Mukherjee

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tty: ipwireless: fix possible NULL dereference
  2016-04-06 11:25 [PATCH] tty: ipwireless: fix possible NULL dereference Sudip Mukherjee
@ 2016-04-07 13:47 ` Jiri Kosina
  2016-04-07 14:28   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2016-04-07 13:47 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: David Sterba, Greg Kroah-Hartman, Jiri Slaby, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tty: ipwireless: fix possible NULL dereference
  2016-04-07 13:47 ` Jiri Kosina
@ 2016-04-07 14:28   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2016-04-07 14:28 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Sudip Mukherjee, David Sterba, Jiri Slaby, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-07 14:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-06 11:25 [PATCH] tty: ipwireless: fix possible NULL dereference Sudip Mukherjee
2016-04-07 13:47 ` Jiri Kosina
2016-04-07 14:28   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox