mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
[PATCH] ibmasm: use after free fix
The kobject_put() can free the memory at *cmd, but cmd->lock points to a persistent lock that is not freed with cmd. Signed-off-by: Max Asbock <masbock@us.ibm.com> Cc: Vernon Mauery <vernux@us.ibm.com> Cc: Srihari Vijayaraghavan <sriharivijayaraghavan@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
a6bf527091
commit
6a88231fc7
1 changed files with 5 additions and 4 deletions
|
@ -101,15 +101,16 @@ struct command {
|
|||
static inline void command_put(struct command *cmd)
|
||||
{
|
||||
unsigned long flags;
|
||||
spinlock_t *lock = cmd->lock;
|
||||
|
||||
spin_lock_irqsave(cmd->lock, flags);
|
||||
kobject_put(&cmd->kobj);
|
||||
spin_unlock_irqrestore(cmd->lock, flags);
|
||||
spin_lock_irqsave(lock, flags);
|
||||
kobject_put(&cmd->kobj);
|
||||
spin_unlock_irqrestore(lock, flags);
|
||||
}
|
||||
|
||||
static inline void command_get(struct command *cmd)
|
||||
{
|
||||
kobject_get(&cmd->kobj);
|
||||
kobject_get(&cmd->kobj);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue