Skip to content

Commit

Permalink
nvmet: fix a memory leak
Browse files Browse the repository at this point in the history
We forgot to free new_model_number

Fixes: 013b7eb ("nvmet: make ctrl model configurable")
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Sagi Grimberg authored and Jens Axboe committed Aug 21, 2020
1 parent 27029b4 commit 382fee1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/nvme/target/configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ static ssize_t nvmet_subsys_attr_model_store(struct config_item *item,
up_write(&nvmet_config_sem);

kfree_rcu(new_model, rcuhead);
kfree(new_model_number);

return count;
}
Expand Down

0 comments on commit 382fee1

Please sign in to comment.