ipack: ipoctal: fix missing allocation-failure check
authorJohan Hovold <johan@kernel.org>
Fri, 17 Sep 2021 11:46:20 +0000 (13:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Oct 2021 13:05:09 +0000 (15:05 +0200)
commit58e818cd994fdd3921dfbbdc67d0b581a2f7aa2f
tree847b5d9c4b51b97d1fbfebc3e152db87807e7967
parent9314f8826b888ecb2ca8a8dc6a0edd90ad29719f
ipack: ipoctal: fix missing allocation-failure check

commit 445c8132727728dc297492a7d9fc074af3e94ba3 upstream.

Add the missing error handling when allocating the transmit buffer to
avoid dereferencing a NULL pointer in write() should the allocation
ever fail.

Fixes: ba4dc61fe8c5 ("Staging: ipack: add support for IP-OCTAL mezzanine board")
Cc: stable@vger.kernel.org # 3.5
Acked-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210917114622.5412-5-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ipack/devices/ipoctal.c