public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ceph: fix potential ERR_PTR dereference in ceph_submit_write()
@ 2026-04-17  8:06 Hongling Zeng
  2026-04-17 17:48 ` Viacheslav Dubeyko
  0 siblings, 1 reply; 3+ messages in thread
From: Hongling Zeng @ 2026-04-17  8:06 UTC (permalink / raw)
  To: idryomov, amarkuze, slava, brauner
  Cc: ceph-devel, linux-kernel, zhongling0719, Hongling Zeng

Fix smatch warning:
 fs/ceph/addr.c:1489 ceph_submit_write() error: 'req' dereferencing possible ERR_PTR()

Add a check to ensure req is not an ERR_PTR before calling
ceph_osdc_put_request().

Fixes: 1551ec61dc55 ("ceph: improve error handling in writeback")
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
---
 fs/ceph/addr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index fa4f25f99409..6091818674be 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1468,7 +1468,8 @@ int ceph_submit_write(struct address_space *mapping,
 			unlock_page(page);
 		}
 
-		ceph_osdc_put_request(req);
+		if (!IS_ERR(req))
+			ceph_osdc_put_request(req);
 		return -EIO;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-20  6:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-17  8:06 [PATCH] ceph: fix potential ERR_PTR dereference in ceph_submit_write() Hongling Zeng
2026-04-17 17:48 ` Viacheslav Dubeyko
2026-04-20  6:28   ` nana

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox