mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
pinctrl: single: Add missing free in single_allocate_function
If func->pins could not be allocated, one must also free func variable that was allocated previously. Signed-off-by: Francois Berder <fberder@outlook.fr> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
This commit is contained in:
committed by
Tom Rini
parent
87c0e413eb
commit
eb52d3fe8a
@@ -282,8 +282,10 @@ static struct single_func *single_allocate_function(struct udevice *dev,
|
||||
|
||||
func->pins = devm_kmalloc(dev, sizeof(unsigned int) * group_pins,
|
||||
GFP_KERNEL);
|
||||
if (!func->pins)
|
||||
if (!func->pins) {
|
||||
devm_kfree(dev, func);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
return func;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user