Commit 807babf
staging: vchiq_arm: Use devm_kzalloc() for drv_mgmt allocation
The struct drv_mgmt 'mgmt' is currently allocated dynamically using
kzalloc(). Unfortunately, it is subjected to memory leaks in the error
handling paths of the probe() function.
To address this issue, use device resource management
helper devm_kzalloc(), to ensure cleanup after the allocation.
Cc: [email protected]
Fixes: 1c9e16b ("staging: vc04_services: vchiq_arm: Split driver static and runtime data")
Signed-off-by: Umang Jain <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 404b739 commit 807babf
File tree
1 file changed
+1
-3
lines changed- drivers/staging/vc04_services/interface/vchiq_arm
1 file changed
+1
-3
lines changedLines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1731 | 1731 | | |
1732 | 1732 | | |
1733 | 1733 | | |
1734 | | - | |
| 1734 | + | |
1735 | 1735 | | |
1736 | 1736 | | |
1737 | 1737 | | |
| |||
1789 | 1789 | | |
1790 | 1790 | | |
1791 | 1791 | | |
1792 | | - | |
1793 | | - | |
1794 | 1792 | | |
1795 | 1793 | | |
1796 | 1794 | | |
| |||
0 commit comments