mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
msm: iommu: Fix NULL pointer dereference
Fix the following NULL pointer dereference issue. Pointer '__p' returned from call to function 'smem_alloc' at line 84 may be NULL and will be dereferenced at line 85. drivers/iommu/msm_iommu.c +85 | _msm_iommu_remote_spin_lock_init() Change-Id: I3549e8dc6cb6b13518ced7d28186da74667c1cb6 Signed-off-by: Binoy Jayan <bjayan@codeaurora.org>
This commit is contained in:
parent
69621fa99e
commit
32edbeece8
1 changed files with 5 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. *
|
||||
/* Copyright (c) 2010-2012, 2016, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
* only version 2 as published by the Free Software Foundation.
|
||||
|
@ -87,8 +88,10 @@ static struct msm_iommu_remote_lock msm_iommu_remote_lock;
|
|||
static void _msm_iommu_remote_spin_lock_init(void)
|
||||
{
|
||||
msm_iommu_remote_lock.lock = smem_alloc(SMEM_SPINLOCK_ARRAY, 32);
|
||||
memset(msm_iommu_remote_lock.lock, 0,
|
||||
if (msm_iommu_remote_lock.lock) {
|
||||
memset(msm_iommu_remote_lock.lock, 0,
|
||||
sizeof(*msm_iommu_remote_lock.lock));
|
||||
}
|
||||
}
|
||||
|
||||
void msm_iommu_remote_p0_spin_lock(void)
|
||||
|
|
Loading…
Reference in a new issue