mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
MIPS: Lantiq: Fix check for return value of request_mem_region()
request_mem_region() returns a pointer and not an integer with an error value. A check for "< 0" on a pointer will cause problems, replace it with not null checks instead. This was found with sparse. Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com> Acked-by: John Crispin <blogic@openwrt.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/11395/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
committed by
Ralf Baechle
parent
13648d7245
commit
6e80785267
@@ -425,12 +425,12 @@ void __init ltq_soc_init(void)
|
||||
of_address_to_resource(np_ebu, 0, &res_ebu))
|
||||
panic("Failed to get core resources");
|
||||
|
||||
if ((request_mem_region(res_pmu.start, resource_size(&res_pmu),
|
||||
res_pmu.name) < 0) ||
|
||||
(request_mem_region(res_cgu.start, resource_size(&res_cgu),
|
||||
res_cgu.name) < 0) ||
|
||||
(request_mem_region(res_ebu.start, resource_size(&res_ebu),
|
||||
res_ebu.name) < 0))
|
||||
if (!request_mem_region(res_pmu.start, resource_size(&res_pmu),
|
||||
res_pmu.name) ||
|
||||
!request_mem_region(res_cgu.start, resource_size(&res_cgu),
|
||||
res_cgu.name) ||
|
||||
!request_mem_region(res_ebu.start, resource_size(&res_ebu),
|
||||
res_ebu.name))
|
||||
pr_err("Failed to request core resources");
|
||||
|
||||
pmu_membase = ioremap_nocache(res_pmu.start, resource_size(&res_pmu));
|
||||
|
||||
Reference in New Issue
Block a user