numam-spdk/lib/bdev
Chen Wang e96a076b51 bdev/raid: fix the double free memory in realloc
Use free() instead of realloc() to free allocated memory.
Currently realloc() is used to free memory unintentionally. Hence
the pointer is not nullified and it has caused double free.
realloc(g_spdk_raid_config.raid_bdev_config, 0)
is equivalent to free(g_spdk_raid_config.raid_bdev_config).

Use Shuhei's patch https://review.gerrithub.io/#/c/spdk/spdk/+/420224/
as a reference.

Fixes GitHub issue #372.

Change-Id: If3b761e3ac10844f734dab9b10d202db9ddc79c0
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/419975
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2018-07-25 17:36:55 +00:00
..
aio bdev: split examine into two parts 2018-07-06 21:12:53 +00:00
error bdev: split examine into two parts 2018-07-06 21:12:53 +00:00
gpt bdev: split examine into two parts 2018-07-06 21:12:53 +00:00
iscsi bdev/iscsi: add inquiry for unmap support 2018-07-25 15:41:58 +00:00
lvol lvol: destroy_lvol_bdev implementation 2018-07-25 17:06:45 +00:00
malloc rpc/bdev: construct RPC return a string instead array 2018-06-22 21:12:43 +00:00
null bdev: add delete_null_bdev call 2018-07-02 22:53:18 +00:00
nvme nvme: change the type of paramter for timeout_callback set 2018-07-19 07:18:17 +00:00
passthru bdev: split examine into two parts 2018-07-06 21:12:53 +00:00
pmem bdev: add delete_pmem_bdev call 2018-07-02 22:53:18 +00:00
raid bdev/raid: fix the double free memory in realloc 2018-07-25 17:36:55 +00:00
rbd bdev/rbd: change the poller to timer poller 2018-07-03 16:40:18 +00:00
rpc bdev: add extra parameters to iostat rpc. 2018-07-12 23:27:27 +00:00
split bdev: split examine into two parts 2018-07-06 21:12:53 +00:00
virtio virtio: allow config read/write to fail 2018-07-05 20:47:38 +00:00
bdev.c bdev: cleanup if bdev init doesn't complete all the way 2018-07-19 01:33:02 +00:00
Makefile bdev: add raid bdev module 2018-07-16 20:50:40 +00:00
part.c bdev: remove public usage of bdev_part_base.ref 2018-07-05 19:12:53 +00:00
scsi_nvme.c bdev: move error union to internal spdk_bdev_io struct 2018-06-26 20:04:07 +00:00
vtune.c bdev: disable new GCC 7 warning in VTune code 2018-03-19 15:58:15 -04:00