Skip to contentSkip to conversation

rpc_pipefs: Replace one label in bl_resolve_deviceid()

PATCH In review Markus Elfring 2 participants 2 messages Dec 29, 2023 – Jan 2, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpc_pipefs: Replace one label in bl_resolve_deviceid()

From: Markus Elfring <[email protected]>
Date: Fri, 29 Dec 2023 13:18:56 +0100

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.

---
 fs/nfs/blocklayout/rpc_pipefs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/blocklayout/rpc_pipefs.c +1 -1
index 6c977288cc28..d8d50a88de04 100644
@@ -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->data = kzalloc(msg->len, gfp_mask);
 	if (!msg->data)
-		goto out_free_data;
+		goto out_unlock;
 
 	bl_msg = msg->data;
 	bl_msg->type = BL_DEVICE_MOUNT;

--
2.43.0

Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Fri, 29 Dec 2023 13:18:56 +0100

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.

Ben