From: Ma Ke <make24@iscas.ac.cn>
To: wintera@linux.ibm.com, twinkler@linux.ibm.com, hca@linux.ibm.com,
gor@linux.ibm.com, agordeev@linux.ibm.com,
borntraeger@linux.ibm.com, svens@linux.ibm.com,
davem@davemloft.net, ubraun@linux.ibm.com, sebott@linux.ibm.com
Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Ma Ke <make24@iscas.ac.cn>
Subject: [PATCH] s390/ism: Add check for dma_set_max_seg_size in ism_probe()
Date: Wed, 26 Jun 2024 16:12:15 +0800 [thread overview]
Message-ID: <20240626081215.2824627-1-make24@iscas.ac.cn> (raw)
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@iscas.ac.cn>
---
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
next reply other threads:[~2024-06-26 8:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 8:12 Ma Ke [this message]
2024-06-26 12:48 ` [PATCH] s390/ism: Add check for dma_set_max_seg_size in ism_probe() Gerd Bayer
2024-06-26 14:00 ` Markus Elfring
2024-06-26 14:26 ` Niklas Schnelle
2024-06-28 5:50 ` Christoph Hellwig
2024-06-26 14:52 ` Markus Elfring
2024-06-28 5:50 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240626081215.2824627-1-make24@iscas.ac.cn \
--to=make24@iscas.ac.cn \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sebott@linux.ibm.com \
--cc=svens@linux.ibm.com \
--cc=twinkler@linux.ibm.com \
--cc=ubraun@linux.ibm.com \
--cc=wintera@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox