1

rpc_pipefs: Replace one label in bl_resolve_deviceid()

The kfree() function was called in one case by
the bl_resolve_deviceid() function during error handling
even if the passed data structure member contained a null pointer.
This issue was detected by using the Coccinelle software.

Thus use an other label.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Markus Elfring 2023-12-29 13:18:56 +01:00 committed by Anna Schumaker
parent 12fc0a9631
commit 597a421798

View File

@ -75,7 +75,7 @@ bl_resolve_deviceid(struct nfs_server *server, struct pnfs_block_volume *b,
msg->len = sizeof(*bl_msg) + b->simple.len; msg->len = sizeof(*bl_msg) + b->simple.len;
msg->data = kzalloc(msg->len, gfp_mask); msg->data = kzalloc(msg->len, gfp_mask);
if (!msg->data) if (!msg->data)
goto out_free_data; goto out_unlock;
bl_msg = msg->data; bl_msg = msg->data;
bl_msg->type = BL_DEVICE_MOUNT; bl_msg->type = BL_DEVICE_MOUNT;