Patch "x86/events/amd/iommu: Fix sizeof mismatch" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    x86/events/amd/iommu: Fix sizeof mismatch

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-events-amd-iommu-fix-sizeof-mismatch.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 16432f693895d9b560e5845c5a77db342673da16
Author: Colin Ian King <colin.king@xxxxxxxxxxxxx>
Date:   Thu Oct 1 12:39:00 2020 +0100

    x86/events/amd/iommu: Fix sizeof mismatch
    
    [ Upstream commit 59d5396a4666195f89a67e118e9e627ddd6f53a1 ]
    
    An incorrect sizeof is being used, struct attribute ** is not correct,
    it should be struct attribute *. Note that since ** is the same size as
    * this is not causing any issues.  Improve this fix by using sizeof(*attrs)
    as this allows us to not even reference the type of the pointer.
    
    Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")
    Fixes: 51686546304f ("x86/events/amd/iommu: Fix sysfs perf attribute groups")
    Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
    Link: https://lkml.kernel.org/r/20201001113900.58889-1-colin.king@xxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c
index fb616203ce427..be50ef8572cce 100644
--- a/arch/x86/events/amd/iommu.c
+++ b/arch/x86/events/amd/iommu.c
@@ -379,7 +379,7 @@ static __init int _init_events_attrs(void)
 	while (amd_iommu_v2_event_descs[i].attr.attr.name)
 		i++;
 
-	attrs = kcalloc(i + 1, sizeof(struct attribute **), GFP_KERNEL);
+	attrs = kcalloc(i + 1, sizeof(*attrs), GFP_KERNEL);
 	if (!attrs)
 		return -ENOMEM;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux