As the possible failure of the dma_set_max_seg_size(), we should better check the return value of the dma_set_max_seg_size(). Fixes: 684b89bc39ce ("s390/ism: add device driver for internal shared memory") Signed-off-by: Ma Ke <make24@xxxxxxxxxxx> --- drivers/s390/net/ism_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c index e36e3ea165d3..9ddd093a0368 100644 --- a/drivers/s390/net/ism_drv.c +++ b/drivers/s390/net/ism_drv.c @@ -620,7 +620,9 @@ static int ism_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto err_resource; dma_set_seg_boundary(&pdev->dev, SZ_1M - 1); - dma_set_max_seg_size(&pdev->dev, SZ_1M); + ret = dma_set_max_seg_size(&pdev->dev, SZ_1M); + if (ret) + return ret; pci_set_master(pdev); ret = ism_dev_init(ism); -- 2.25.1