linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] scatterlist: make sgl_free null pointer safe
@ 2019-09-20 18:18 Sagi Grimberg
  2019-09-20 18:18 ` [PATCH 2/2] nvmet-tcp: remove superflous check on request sgl Sagi Grimberg
  2019-09-22  5:33 ` [PATCH 1/2] scatterlist: make sgl_free null pointer safe Chaitanya Kulkarni
  0 siblings, 2 replies; 6+ messages in thread
From: Sagi Grimberg @ 2019-09-20 18:18 UTC (permalink / raw)
  To: linux-nvme; +Cc: Keith Busch, Christoph Hellwig

Match other alloc/free routines by checking the sgl pointer first.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
 lib/scatterlist.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index c2cf2c311b7d..fea25b035e67 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -563,6 +563,9 @@ void sgl_free_n_order(struct scatterlist *sgl, int nents, int order)
 	struct page *page;
 	int i;
 
+	if (!sgl)
+		return;
+
 	for_each_sg(sgl, sg, nents, i) {
 		if (!sg)
 			break;
-- 
2.17.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

end of thread, other threads:[~2019-09-27 21:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 18:18 [PATCH 1/2] scatterlist: make sgl_free null pointer safe Sagi Grimberg
2019-09-20 18:18 ` [PATCH 2/2] nvmet-tcp: remove superflous check on request sgl Sagi Grimberg
2019-09-22  5:37   ` Chaitanya Kulkarni
2019-09-27 21:22   ` Christoph Hellwig
2019-09-22  5:33 ` [PATCH 1/2] scatterlist: make sgl_free null pointer safe Chaitanya Kulkarni
2019-09-23 17:05   ` Sagi Grimberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).