linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sample: vfio mdev display - Fix a missing error code in an error handling path
@ 2019-09-16 20:22 Christophe JAILLET
  2019-09-18 18:49 ` Alex Williamson
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2019-09-16 20:22 UTC (permalink / raw)
  To: kwankhede; +Cc: kvm, linux-kernel, kernel-janitors, Christophe JAILLET

'ret' is known to be 0 at this point. So explicitly set it to -ENOMEM if
'framebuffer_alloc()' fails.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 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 2719bb259653..6fe0187f47a2 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;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-18 18:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-16 20:22 [PATCH] sample: vfio mdev display - Fix a missing error code in an error handling path Christophe JAILLET
2019-09-18 18:49 ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).