Re: [PATCH] tty: ipwireless: fix potential NULL pointer dereference

From: David Sterba
Date: Tue Jun 06 2017 - 06:40:46 EST


On Mon, Jun 05, 2017 at 03:50:02PM -0500, Gustavo A. R. Silva wrote:
> Add null check before dereferencing pointer ver_packet.
> Print error message and exit in case pointer ver_packet
> is NULL.

And what next? The caller does not expect a failure and continues as if
the packet has been set up and sent and waiting for a response. This
will likely hang somewhere or just do nothing regarding
sending/receiving user packets. Failures of alloc_ctrl_packet are
handled elsewhere, even during the setup phase so this could be handled
more gracefully.