From: Wei Yongjun <weiyongjun1@huawei.com>
To: Kirti Wankhede <kwankhede@nvidia.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
kvm@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH -next] samples: vfio-mdev: fix error return code in mdpy_fb_probe()
Date: Mon, 27 Apr 2020 14:21:10 +0000 [thread overview]
Message-ID: <20200427142110.56121-1-weiyongjun1@huawei.com> (raw)
Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
samples/vfio-mdev/mdpy-fb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/samples/vfio-mdev/mdpy-fb.c b/samples/vfio-mdev/mdpy-fb.c
index 21dbf63d6e41..d4abc0594dbd 100644
--- a/samples/vfio-mdev/mdpy-fb.c
+++ b/samples/vfio-mdev/mdpy-fb.c
@@ -131,8 +131,10 @@ static int mdpy_fb_probe(struct pci_dev *pdev,
width, height);
info = framebuffer_alloc(sizeof(struct mdpy_fb_par), &pdev->dev);
- if (!info)
+ if (!info) {
+ ret = -ENOMEM;
goto err_release_regions;
+ }
pci_set_drvdata(pdev, info);
par = info->par;
next reply other threads:[~2020-04-27 14:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-27 14:21 Wei Yongjun [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-05-19 14:15 [PATCH -next] samples: vfio-mdev: fix error return code in mdpy_fb_probe() Wei Yongjun
2021-05-19 15:45 ` Alex Williamson
2021-05-20 5:25 ` Dan Carpenter
2021-05-20 8:10 ` weiyongjun (A)
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=20200427142110.56121-1-weiyongjun1@huawei.com \
--to=weiyongjun1@huawei.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.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