From patchwork Mon Sep 23 15:00:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2928731 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1C9E49F288 for ; Mon, 23 Sep 2013 15:00:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73A0820334 for ; Mon, 23 Sep 2013 15:00:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6B8D20308 for ; Mon, 23 Sep 2013 15:00:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752612Ab3IWPAk (ORCPT ); Mon, 23 Sep 2013 11:00:40 -0400 Received: from mail-we0-f179.google.com ([74.125.82.179]:60760 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314Ab3IWPAk (ORCPT ); Mon, 23 Sep 2013 11:00:40 -0400 Received: by mail-we0-f179.google.com with SMTP id x55so3147204wes.24 for ; Mon, 23 Sep 2013 08:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=jCpJ9QxvoFr52xbEFuO71+pu++okYuV4cEUSc2nCTN8=; b=oD4+xqQrmaYE9AZdVcHHKWr3yyraqWQWD3d3j+P/EuB11r0x3Mx8zjtzl98s4Uz/p7 J881qyZ+fjHIIXcm4YzMjtyqJCwSZF1mMTPSYuwjr/HFY92wuvU6YEzyd8ulVLEmSoBW eP23P7+MuOQPNgoLlazzXhSVQhDKnQBcpEireY3ZjY3LRkyB0kzyqflm6JLy5jScNpp/ S3g8T4ksf3hqVa43ag7v9lXFx3qPMkAn6PPXtD1rEOreOLRUG7wC6hd+O1ksfMbQZ1Dv WrYCfCAdleT0GaBa+HaGV21FpSshnehKNyDmLTuZ7vOE9PYLzlkCOl9HTYjFv5rYEZZN VklA== MIME-Version: 1.0 X-Received: by 10.181.12.16 with SMTP id em16mr13803523wid.36.1379948434187; Mon, 23 Sep 2013 08:00:34 -0700 (PDT) Received: by 10.194.201.3 with HTTP; Mon, 23 Sep 2013 08:00:34 -0700 (PDT) Date: Mon, 23 Sep 2013 23:00:34 +0800 Message-ID: Subject: [PATCH] neofb: fix error return code in neofb_probe() From: Wei Yongjun To: plagnioj@jcrosoft.com, tomi.valkeinen@ti.com Cc: yongjun_wei@trendmicro.com.cn, linux-fbdev@vger.kernel.org Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/video/neofb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c index 891b0bf..2a3e5bd 100644 --- a/drivers/video/neofb.c +++ b/drivers/video/neofb.c @@ -2075,6 +2075,7 @@ static int neofb_probe(struct pci_dev *dev, const struct pci_device_id *id) if (!fb_find_mode(&info->var, info, mode_option, NULL, 0, info->monspecs.modedb, 16)) { printk(KERN_ERR "neofb: Unable to find usable video mode.\n"); + err = -EINVAL; goto err_map_video; } @@ -2097,7 +2098,8 @@ static int neofb_probe(struct pci_dev *dev, const struct pci_device_id *id) info->fix.smem_len >> 10, info->var.xres, info->var.yres, h_sync / 1000, h_sync % 1000, v_sync); - if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) + err = fb_alloc_cmap(&info->cmap, 256, 0); + if (err < 0) goto err_map_video; err = register_framebuffer(info);