From patchwork Mon Aug 15 15:03:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9282443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BDA1E60467 for ; Tue, 16 Aug 2016 00:36:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEFB828E97 for ; Tue, 16 Aug 2016 00:36:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A39A628E9E; Tue, 16 Aug 2016 00:36:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5AD0428E97 for ; Tue, 16 Aug 2016 00:36:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C68506E5FA; Tue, 16 Aug 2016 00:36:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-x241.google.com (mail-pa0-x241.google.com [IPv6:2607:f8b0:400e:c03::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id B1C726E56D for ; Mon, 15 Aug 2016 15:04:02 +0000 (UTC) Received: by mail-pa0-x241.google.com with SMTP id vy10so3720342pac.0 for ; Mon, 15 Aug 2016 08:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ermZWZ3O/pBVpEfm473vT9pe30adXzNIFko8PNfpqYA=; b=zwtYdV2RqWkdEdSPsj7Ea0awRKZSlDVEOf7omWjq9K1BXBkXp3CrsXpjFFWv5KwczM EGkPU2z0tFm9gaF4qAVJpuPtyU88Z/LnluMGQ6UpNUAUPlyVxcfX2VcTKz9NS4nSTnMK kkPY9QCO7r0L4fimGIwTGMqD7gYm/XVZ5Z4EmgcVhEUGnhndAlFdUQ3ITpC1UPfGezzF oJT/+rI5QHOFHRPp/D8GoCCCEXZ5HBMG2XXTBPkttYaQlwobdpk+3G4/Mwfg2lhdr6QI kXH79j6K4SGnpu5ZH91/MD928RRP3ivbZjhI0YCZVbHA+3aoybkzMP8u8svX9WLTnVZu SlVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ermZWZ3O/pBVpEfm473vT9pe30adXzNIFko8PNfpqYA=; b=BZUfKO2+OMWfs2eCzTMeYL2As4msi2aKQ6/0T2KXZ/uXdmNO/EsX0GQdXXqSfLFenH GgjCKZ98QnFHyc0aeXIia+hTMoiYEl6L5dLt5tLCBu9hnQa0AUcNTcQKDCmbpvGu2SKV kaN4iSTMI3MDiB/s76xejxgANPU7005iQs+MsH9o5dMnBcdaQHR0GF9Jc0GNCfJHbRvN ESdl0ykl/du36MoWD/HK4bJbYRttODnGO7Yn8xvYYQWFYFYL/LLTwMzrqynD9WC3E6Jj 2bezvLtCawX8JF+lzKA8+Sl/zql2tPWQ4P/9oSGQDrfq8IUkYWGRxwxqPyJ1tjGRlbz4 jPBA== X-Gm-Message-State: AEkooutgWk/bDc5jVwWVY65oHwA63grS31Otj0evIvPRpCc3RiEwG+CQPB6QlNdXctbtrw== X-Received: by 10.66.15.138 with SMTP id x10mr54409007pac.92.1471273442183; Mon, 15 Aug 2016 08:04:02 -0700 (PDT) Received: from bogon.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id 84sm32237667pfp.59.2016.08.15.08.03.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Aug 2016 08:04:01 -0700 (PDT) From: Wei Yongjun To: airlied@redhat.com, airlied@linux.ie, daniel.vetter@ffwll.ch, architt@codeaurora.org, ville.syrjala@linux.intel.com, alexander.deucher@amd.com Subject: [PATCH -next] drm/mgag200: fix error return code in mgag200fb_create() Date: Mon, 15 Aug 2016 15:03:51 +0000 Message-Id: <1471273431-6753-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 16 Aug 2016 00:36:24 +0000 Cc: Wei Yongjun , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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)) {