]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: don't free uuid pointer before printing it
authorJohannes Thumshirn <jthumshirn@suse.de>
Thu, 25 Jan 2018 08:09:25 +0000 (09:09 +0100)
committerChristoph Hellwig <hch@lst.de>
Thu, 25 Jan 2018 17:41:39 +0000 (18:41 +0100)
commit4c6ba67151067ceacd10f0a78aa659f0c7f1983c
tree91644918bd8b60f549d46231469a53335f49c1db
parent0e8580b59db32571917e0f5518cca90236d8dc2e
nvme: don't free uuid pointer before printing it

Commit b58e43b620a5 ("nvme-fabrics: fix memory leak when parsing host ID
option") fixed the leak of 'p' but in case uuid_parse() fails the memory
is freed before the error print that is using it.

Free it after printing eventual errors.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Fixes: b58e43b620a5 ("nvme-fabrics: fix memory leak when parsing host ID option")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fabrics.c