Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 89924fdb authored by Mitchel Humpherys's avatar Mitchel Humpherys Committed by Patrick Daly
Browse files

iommu/iommu-debug: Initialize debug device to 0



Currently the debug device structure is allocated with kmalloc, without
initializing all of the fields in the structure.  Later, those fields
might be uses before they've every been assigned. For example, if a user
executes the following code on a fresh boot:

    # cd /sys/kernel/debug/iommu/tests/some_device
    # echo 0 > attach

The kernel crashes with something like this (assuming page poisoning is
enabled):

 Unable to handle kernel paging request at virtual address aaaaaaaaaaaaaaaa
 pgd = ffffffc0a92a1000
 [aaaaaaaaaaaaaaaa] *pgd=0000000000000000, *pud=0000000000000000

Fix this by initializing all the fields in the structure to 0 by using
kzalloc instead of kmalloc.

Change-Id: I3514bf7bf174e176ff7a310c7134d0f53e22d771
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent 0fe337d5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment