Skip to contentSkip to conversation

nvme-tcp: memset scatterlist before sg_init_marker it

PATCH Applied Jackie Liu 3 participants 3 messages Dec 20, 2021 – Dec 21, 2021 NVMe

lore
Share & tools
lore

Jackie Liu

author
#0 lore raw

PATCH 1/1 nvme-tcp: memset scatterlist before sg_init_marker it

From: Jackie Liu <[email protected]>

sg_init_marker's sg need initialized, otherwise report:

[...]
In file included from ../include/linux/dma-mapping.h:10,

                 from ../include/linux/skbuff.h:31,
                 from ../include/net/net_namespace.h:39,
                 from ../include/linux/netdevice.h:37,
                 from ../include/net/sock.h:46,
                 from ../drivers/nvme/host/tcp.c:12:
../drivers/nvme/host/tcp.c: In function ‘nvme_tcp_ddgst_update’:
../include/linux/scatterlist.h:214:16: error: ‘sg.page_link’ is used uninitialized in this function [-Werror=uninitialized]
  214 |  sg->page_link |= SG_END;
      |                ^~

cc1: all warnings being treated as errors
make[4]: *** [../scripts/Makefile.build:287: drivers/nvme/host/tcp.o] Error 1 make[3]: *** [../scripts/Makefile.build:549: drivers/nvme/host] Error 2 make[2]: *** [../scripts/Makefile.build:549: drivers/nvme] Error 2 make[2]: *** Waiting for unfinished jobs....
[...]

---
 drivers/nvme/host/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/tcp.c +1 -1
index 4ceb28675fdf..8fd8cbe23683 100644
@@ -348,7 +348,7 @@ static inline void nvme_tcp_ddgst_update(struct ahash_request *hash,
 {
 	struct scatterlist sg;
 
-	sg_init_marker(&sg, 1);
+	sg_init_table(&sg, 1);
 	sg_set_page(&sg, page, len, off);
 	ahash_request_set_crypt(hash, &sg, NULL, len);
 	crypto_ahash_update(hash);
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Jackie Liu

From: Jackie Liu <[email protected]>

sg_init_marker's sg need initialized, otherwise report:

[...]
In file included from ../include/linux/dma-mapping.h:10,

                  from ../include/linux/skbuff.h:31,
                  from ../include/net/net_namespace.h:39,
                  from ../include/linux/netdevice.h:37,
                  from ../include/net/sock.h:46,
                  from ../drivers/nvme/host/tcp.c:12:
../drivers/nvme/host/tcp.c: In function ‘nvme_tcp_ddgst_update’:
../include/linux/scatterlist.h:214:16: error: ‘sg.page_link’ is used uninitialized in this function [-Werror=uninitialized]
   214 |  sg->page_link |= SG_END;
       |                ^~
Quoted 6 lines

cc1: all warnings being treated as errors
make[4]: *** [../scripts/Makefile.build:287: drivers/nvme/host/tcp.o] Error 1 make[3]: *** [../scripts/Makefile.build:549: drivers/nvme/host] Error 2 make[2]: *** [../scripts/Makefile.build:549: drivers/nvme] Error 2 make[2]: *** Waiting for unfinished jobs....
[...]

This needs:

Fixes 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver")
Quoted 13 lines
---
  drivers/nvme/host/tcp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/tcp.c +0 -0
index 4ceb28675fdf..8fd8cbe23683 100644

drivers/nvme/host/tcp.c static inline void nvme_tcp_ddgst_update(struct ahash_request *hash, · line 354

Quoted 8 lines
drivers/nvme/host/tcp.c +1 -1
@@ -348,7 +348,7 @@ static inline void nvme_tcp_ddgst_update(struct ahash_request *hash,
  {
  	struct scatterlist sg;
 
-	sg_init_marker(&sg, 1);
+	sg_init_table(&sg, 1);
  	sg_set_page(&sg, page, len, off);
  	ahash_request_set_crypt(hash, &sg, NULL, len);
  	crypto_ahash_update(hash);