From c1e89d597da00d259e51f6451fc8956173a531de Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Mon, 28 Jul 2025 13:37:33 -0400 Subject: [PATCH] Fix NULL dereference on error branch in handle_request. If scoutfs_send_omap_response fails for any reason, req is NULL and we would hit a hard NULL deref during unwinding. Signed-off-by: Auke Kok --- kmod/src/omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod/src/omap.c b/kmod/src/omap.c index c39dbc9c..4731668b 100644 --- a/kmod/src/omap.c +++ b/kmod/src/omap.c @@ -592,7 +592,7 @@ static int handle_request(struct super_block *sb, struct omap_request *req) ret = 0; out: free_rids(&priv_rids); - if (ret < 0) { + if ((ret < 0) && (req != NULL)) { ret = scoutfs_server_send_omap_response(sb, req->client_rid, req->client_id, NULL, ret); free_req(req);