* [PATCH] scsi: wd719x: Return proper error code when dma_set_mask() fails
@ 2022-02-28 14:54 Zheyu Ma
2022-02-28 15:43 ` Johannes Thumshirn
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Zheyu Ma @ 2022-02-28 14:54 UTC (permalink / raw)
To: jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, Zheyu Ma
During the process of driver probing, the probe function should return < 0
for failure, otherwise, the kernel will treat value >= 0 as success.
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
drivers/scsi/wd719x.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c
index 1a7947554581..2b24ef387d57 100644
--- a/drivers/scsi/wd719x.c
+++ b/drivers/scsi/wd719x.c
@@ -904,7 +904,8 @@ static int wd719x_pci_probe(struct pci_dev *pdev, const struct pci_device_id *d)
if (err)
goto fail;
- if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
+ err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+ if (err) {
dev_warn(&pdev->dev, "Unable to set 32-bit DMA mask\n");
goto disable_device;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: wd719x: Return proper error code when dma_set_mask() fails
2022-02-28 14:54 [PATCH] scsi: wd719x: Return proper error code when dma_set_mask() fails Zheyu Ma
@ 2022-02-28 15:43 ` Johannes Thumshirn
2022-03-02 4:22 ` Martin K. Petersen
2022-03-09 4:14 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2022-02-28 15:43 UTC (permalink / raw)
To: Zheyu Ma, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel
On 28/02/2022 15:54, Zheyu Ma wrote:
> During the process of driver probing, the probe function should return < 0
> for failure, otherwise, the kernel will treat value >= 0 as success.
"So set 'err' to the error value returned by dma_set_mask() in case of failure"
Otherwise looks good to me,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: wd719x: Return proper error code when dma_set_mask() fails
2022-02-28 14:54 [PATCH] scsi: wd719x: Return proper error code when dma_set_mask() fails Zheyu Ma
2022-02-28 15:43 ` Johannes Thumshirn
@ 2022-03-02 4:22 ` Martin K. Petersen
2022-03-09 4:14 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2022-03-02 4:22 UTC (permalink / raw)
To: Zheyu Ma; +Cc: jejb, martin.petersen, linux-scsi, linux-kernel
Zheyu,
> During the process of driver probing, the probe function should return
> < 0 for failure, otherwise, the kernel will treat value >= 0 as
> success.
Applied to 5.18/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: wd719x: Return proper error code when dma_set_mask() fails
2022-02-28 14:54 [PATCH] scsi: wd719x: Return proper error code when dma_set_mask() fails Zheyu Ma
2022-02-28 15:43 ` Johannes Thumshirn
2022-03-02 4:22 ` Martin K. Petersen
@ 2022-03-09 4:14 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2022-03-09 4:14 UTC (permalink / raw)
To: jejb, Zheyu Ma; +Cc: Martin K . Petersen, linux-kernel, linux-scsi
On Mon, 28 Feb 2022 14:54:15 +0000, Zheyu Ma wrote:
> During the process of driver probing, the probe function should return < 0
> for failure, otherwise, the kernel will treat value >= 0 as success.
>
>
Applied to 5.18/scsi-queue, thanks!
[1/1] scsi: wd719x: Return proper error code when dma_set_mask() fails
https://git.kernel.org/mkp/scsi/c/98cdcd6c6b4a
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-03-09 4:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 14:54 [PATCH] scsi: wd719x: Return proper error code when dma_set_mask() fails Zheyu Ma
2022-02-28 15:43 ` Johannes Thumshirn
2022-03-02 4:22 ` Martin K. Petersen
2022-03-09 4:14 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.