tty: ipwireless: fix missing checks for ioremap
authorKangjie Lu <kjlu@umn.edu>
Fri, 15 Mar 2019 07:07:12 +0000 (02:07 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:46:30 +0000 (06:46 -0700)
commit19ae270d1ce004ec8019754e8e2c72c27167a41d
tree4b567eac144d11b8c8e6c05cbf3f0c1c565cba3f
parent3392cc5f3ce3cd67d2a8dc7ebbb271e660569bd3
tty: ipwireless: fix missing checks for ioremap

[ Upstream commit 1bbb1c318cd8a3a39e8c3e2e83d5e90542d6c3e3 ]

ipw->attr_memory and ipw->common_memory are assigned with the
return value of ioremap. ioremap may fail, but no checks
are enforced. The fix inserts the checks to avoid potential
NULL pointer dereferences.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/ipwireless/main.c