All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <weiyj.lk@gmail.com>
To: airlied@redhat.com, airlied@linux.ie, daniel.vetter@ffwll.ch,
	architt@codeaurora.org, ville.syrjala@linux.intel.com,
	alexander.deucher@amd.com
Cc: Wei Yongjun <weiyj.lk@gmail.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH -next] drm/mgag200: fix error return code in mgag200fb_create()
Date: Mon, 15 Aug 2016 15:03:51 +0000	[thread overview]
Message-ID: <1471273431-6753-1-git-send-email-weiyj.lk@gmail.com> (raw)

Fix to return error code -ENOMEM from the vmalloc() error handling
case instead of 0, as done elsewhere in this function.

Fixes: aec9e12953e7 ("drm/mgag200: Fix error handling paths in fbdev driver")
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
---
 drivers/gpu/drm/mgag200/mgag200_fb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c
index 81325f6..88dd221 100644
--- a/drivers/gpu/drm/mgag200/mgag200_fb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
@@ -183,8 +183,10 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
 	}
 
 	sysram = vmalloc(size);
-	if (!sysram)
+	if (!sysram) {
+		ret = -ENOMEM;
 		goto err_sysram;
+	}
 
 	info = drm_fb_helper_alloc_fbi(helper);
 	if (IS_ERR(info)) {

             reply	other threads:[~2016-08-15 15:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15 15:03 Wei Yongjun [this message]
2016-08-15 16:04 ` [PATCH -next] drm/mgag200: fix error return code in mgag200fb_create() Daniel Vetter
2016-08-15 16:04   ` Daniel Vetter

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=1471273431-6753-1-git-send-email-weiyj.lk@gmail.com \
    --to=weiyj.lk@gmail.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=alexander.deucher@amd.com \
    --cc=architt@codeaurora.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ville.syrjala@linux.intel.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 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.