Skip to content

Commit

Permalink
parport: fix memory leak
Browse files Browse the repository at this point in the history
After the reference count becomes 0 when put_device() is called, it will
execute the release callback where we are freeing all the allocated
memory associated with the device. We missed freeing par_dev->state.

Signed-off-by: Sudip Mukherjee <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and gregkh committed Jul 23, 2015
1 parent cabea69 commit 23c4059
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/parport/share.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ static void free_pardevice(struct device *dev)
struct pardevice *par_dev = to_pardevice(dev);

kfree(par_dev->name);
kfree(par_dev->state);
kfree(par_dev);
}

Expand Down

0 comments on commit 23c4059

Please sign in to comment.