linux/drivers/misc/altera-stapl
Colin Ian King 47cf54a6b6 altera-stapl: check for a null key before strcasecmp'ing it
commit 9ccb645683 upstream.

Currently the null check on key is occurring after the strcasecmp on
the key, hence there is a potential null pointer dereference on key.
Fix this by checking if key is null first. Also replace the == 0
check on strcasecmp with just the ! operator.

Detected by CoverityScan, CID#1248787 ("Dereference before null check")

Fixes: fa766c9be5 ("[media] Altera FPGA firmware download module")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.16: old code used strnicmp()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-04-04 16:13:45 +01:00
..
altera-comp.c [media] altera-stapl: it is time to move out from staging 2011-09-23 15:00:57 -03:00
altera-exprt.h [media] altera-stapl: it is time to move out from staging 2011-09-23 15:00:57 -03:00
altera-jtag.c [media] altera-stapl: it is time to move out from staging 2011-09-23 15:00:57 -03:00
altera-jtag.h [media] altera-stapl: it is time to move out from staging 2011-09-23 15:00:57 -03:00
altera-lpt.c [media] altera-stapl: it is time to move out from staging 2011-09-23 15:00:57 -03:00
altera.c altera-stapl: check for a null key before strcasecmp'ing it 2019-04-04 16:13:45 +01:00
Kconfig [media] altera-stapl: it is time to move out from staging 2011-09-23 15:00:57 -03:00
Makefile [media] altera-stapl: it is time to move out from staging 2011-09-23 15:00:57 -03:00