Skip to contentSkip to conversation

s390/dasd: module warning and error check fix

PATCH Applied Stefan Haberland 2 participants 4 messages Jul 15, 2024

Subsystems (3)
lore
Share & tools
lore

Stefan Haberland

author maintainer
#0 lore raw

cover s390/dasd: module warning and error check fix

Hi Jens,

please apply the following two patches for the merge window. They fix module description warnings and an error check in a dasd function.

Carlos López (1):
s390/dasd: fix error checks in dasd_copy_pair_store()

Jeff Johnson (1):
s390/dasd: add missing MODULE_DESCRIPTION() macros

 drivers/s390/block/dasd_devmap.c | 10 ++++++++--
 drivers/s390/block/dasd_diag.c   |  1 +
 drivers/s390/block/dasd_eckd.c   |  1 +
 drivers/s390/block/dasd_fba.c    |  1 +
 4 files changed, 11 insertions(+), 2 deletions(-)
Signature · 1 line
2.40.1
author maintainer
#1 lore raw

PATCH 1/2 s390/dasd: add missing MODULE_DESCRIPTION() macros

From: Jeff Johnson <[email protected]>

With ARCH=s390, make allmodconfig && make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/s390/block/dasd_diag_mod.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/s390/block/dasd_eckd_mod.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/s390/block/dasd_fba_mod.o

Add the missing invocations of the MODULE_DESCRIPTION() macro.

---
 drivers/s390/block/dasd_diag.c | 1 +
 drivers/s390/block/dasd_eckd.c | 1 +
 drivers/s390/block/dasd_fba.c  | 1 +
 3 files changed, 3 insertions(+)
drivers/s390/block/dasd_diag.c +1 -0
index ea4b1d01bb76..8245b742e4a2 100644
@@ -29,6 +29,7 @@
 #include "dasd_int.h"
 #include "dasd_diag.h"
 
+MODULE_DESCRIPTION("S/390 Support for DIAG access to DASD Disks");
 MODULE_LICENSE("GPL");
 
 /* The maximum number of blocks per request (max_blocks) is dependent on the
drivers/s390/block/dasd_eckd.c +1 -0
index a76c6af9ea63..9388b5c383ca 100644
@@ -44,6 +44,7 @@
 /* 64k are 128 x 512 byte sectors  */
 #define DASD_RAW_SECTORS_PER_TRACK 128
 
+MODULE_DESCRIPTION("S/390 DASD ECKD Disks device driver");
 MODULE_LICENSE("GPL");
 
 static struct dasd_discipline dasd_eckd_discipline;
drivers/s390/block/dasd_fba.c +1 -0
index 9f2023a077c2..a2216795591d 100644
@@ -32,6 +32,7 @@
 #define DASD_FBA_CCW_LOCATE 0x43
 #define DASD_FBA_CCW_DEFINE_EXTENT 0x63
 
+MODULE_DESCRIPTION("S/390 DASD FBA Disks device driver");
 MODULE_LICENSE("GPL");
 
 static struct dasd_discipline dasd_fba_discipline;
Signature · 1 line
2.40.1
author maintainer
#2 lore raw

PATCH 2/2 s390/dasd: fix error checks in dasd_copy_pair_store()

In reply to Stefan Haberland

From: Carlos López <[email protected]>

dasd_add_busid() can return an error via ERR_PTR() if an allocation fails. However, two callsites in dasd_copy_pair_store() do not check the result, potentially resulting in a NULL pointer dereference. Fix this by checking the result with IS_ERR() and returning the error up the stack.

Fixes a91ff09d39f9b ("s390/dasd: add copy pair setup")
---
 drivers/s390/block/dasd_devmap.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/s390/block/dasd_devmap.c +8 -2
index 0316c20823ee..6adaeb985dde 100644
@@ -2248,13 +2248,19 @@ static ssize_t dasd_copy_pair_store(struct device *dev,
 
 	/* allocate primary devmap if needed */
 	prim_devmap = dasd_find_busid(prim_busid);
-	if (IS_ERR(prim_devmap))
+	if (IS_ERR(prim_devmap)) {
 		prim_devmap = dasd_add_busid(prim_busid, DASD_FEATURE_DEFAULT);
+		if (IS_ERR(prim_devmap))
+			return PTR_ERR(prim_devmap);
+	}
 
 	/* allocate secondary devmap if needed */
 	sec_devmap = dasd_find_busid(sec_busid);
-	if (IS_ERR(sec_devmap))
+	if (IS_ERR(sec_devmap)) {
 		sec_devmap = dasd_add_busid(sec_busid, DASD_FEATURE_DEFAULT);
+		if (IS_ERR(sec_devmap))
+			return PTR_ERR(sec_devmap);
+	}
 
 	/* setting copy relation is only allowed for offline secondary */
 	if (sec_devmap->device)
Signature · 1 line
2.40.1
maintainer Applied
#3 lore raw
In reply to Stefan Haberland
Quoted 10 lines · Stefan Haberland

please apply the following two patches for the merge window. They fix module description warnings and an error check in a dasd function.

Carlos López (1):
s390/dasd: fix error checks in dasd_copy_pair_store()

Jeff Johnson (1):
s390/dasd: add missing MODULE_DESCRIPTION() macros

[...]

Applied, thanks!

[1/2] s390/dasd: add missing MODULE_DESCRIPTION() macros

      commit: 1f5a33315362cb8ade2b15489c985ada0cc8623b
[2/2] s390/dasd: fix error checks in dasd_copy_pair_store()
      commit: 8e64d2356cbc800b4cd0e3e614797f76bcf0cdb8

Best regards,

Signature · 1 line
Jens Axboe