mirror of
https://github.com/torvalds/linux.git
synced 2026-06-10 07:32:29 +02:00
devres: fix devres_get()
commit64526370d1upstream. Currently, devres_get() passes devres_free() the pointer to devres, but devres_free() should be given with the pointer to resource data. Fixes:9ac7849e35("devres: device resource management") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0bd183de61
commit
db4d79952c
|
|
@ -296,10 +296,10 @@ void * devres_get(struct device *dev, void *new_res,
|
|||
if (!dr) {
|
||||
add_dr(dev, &new_dr->node);
|
||||
dr = new_dr;
|
||||
new_dr = NULL;
|
||||
new_res = NULL;
|
||||
}
|
||||
spin_unlock_irqrestore(&dev->devres_lock, flags);
|
||||
devres_free(new_dr);
|
||||
devres_free(new_res);
|
||||
|
||||
return dr->data;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user