Skip to content

Commit 29b74cb

Browse files
Wei Yongjundavem330
authored andcommitted
s390/ism: fix error return code in ism_probe()
Fix to return negative error code -ENOMEM from the smcd_alloc_dev() error handling case instead of 0, as done elsewhere in this function. Fixes: 684b89b ("s390/ism: add device driver for internal shared memory") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Ursula Braun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent eead1c2 commit 29b74cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/s390/net/ism_drv.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,10 @@ static int ism_probe(struct pci_dev *pdev, const struct pci_device_id *id)
521521

522522
ism->smcd = smcd_alloc_dev(&pdev->dev, dev_name(&pdev->dev), &ism_ops,
523523
ISM_NR_DMBS);
524-
if (!ism->smcd)
524+
if (!ism->smcd) {
525+
ret = -ENOMEM;
525526
goto err_resource;
527+
}
526528

527529
ism->smcd->priv = ism;
528530
ret = ism_dev_init(ism);

0 commit comments

Comments
 (0)