]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
netapp-nvme: fix smdevices segfault in json output
authorMartin George <marting@netapp.com>
Fri, 18 Mar 2022 08:21:06 +0000 (13:51 +0530)
committerMartin George <marting@netapp.com>
Fri, 18 Mar 2022 08:21:06 +0000 (13:51 +0530)
commitff9597d28d957b18639b0e93f45440e13b71687a
tree5f6c74702c317a8edf085856d6b4c276e123ccd4
parentaeca69dcb807071545cee31d195c16fc6da23168
netapp-nvme: fix smdevices segfault in json output

After the upgrade to libnvme, the NetApp plugin for smdevices
segfaults due to the wrong json object type as shown below:

nvme: json_object.c:1194: json_object_array_add:
Assertion `json_object_get_type(jso) == json_type_array' failed.
Aborted (core dumped)

Fix this by passing the appropriate json array type for smdevices.
Also include a couple of minor changes as well - add a newline to
the end of the json output, and then free the json root device.

Signed-off-by: Martin George <marting@netapp.com>
Tested-by: Clayton Skaggs <claytons@netapp.com>
plugins/netapp/netapp-nvme.c