From patchwork Wed Oct 3 12:40:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Senna Tschudin X-Patchwork-Id: 1541351 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0991DDFF71 for ; Wed, 3 Oct 2012 12:41:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754881Ab2JCMlJ (ORCPT ); Wed, 3 Oct 2012 08:41:09 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:37020 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753081Ab2JCMlF (ORCPT ); Wed, 3 Oct 2012 08:41:05 -0400 Received: by wgbdr13 with SMTP id dr13so6094219wgb.1 for ; Wed, 03 Oct 2012 05:41:03 -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:x-mailer; bh=qYLrPSHh/c1Xrd74Mq2cLlTJkv/VJD8uUhKzVh8F3hM=; b=QJwX/yEK2De8RRSx+kI8eiGq9wkd2q0nEZ3/Wia91nbt87CsftufGbzXk48bp7X1Pa legZQdpI+l8Auhtd5EHwTUA03iPXH8qe55Roh0PicoaT9BYMQgbo5EqIIUAqsJ0Uzxa/ emzVmThA3Yc4tFA3gR8NJmsGybXksxneWOzokbhy+pJDkFw3LwOJ6S38AzcKgqNzJmgC 7FWAroVIKDlezPm5ciYyh1gAYbcko9ZbTipCnQwyqwpaOmxhS+DBFME2PI2KoXY/bmQ4 oFdXov8IBGDawTvqj4nkJFCy3+/wN+IdwrDqYVgTZLHyLZl/w+xm32zx7LdsAnW+baK7 Y0JQ== Received: by 10.180.83.234 with SMTP id t10mr4759313wiy.7.1349268063758; Wed, 03 Oct 2012 05:41:03 -0700 (PDT) Received: from localhost.localdomain (ppeter.rsr.lip6.fr. [132.227.76.16]) by mx.google.com with ESMTPS id k2sm8266198wiz.7.2012.10.03.05.41.03 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 03 Oct 2012 05:41:03 -0700 (PDT) From: Peter Senna Tschudin To: Antonino Daplas Cc: kernel-janitors@vger.kernel.org, Florian Tobias Schandinat , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] drivers/video/savage/savagefb_driver.c: fix error return code Date: Wed, 3 Oct 2012 14:40:43 +0200 Message-Id: <1349268044-32616-1-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Peter Senna Tschudin Convert a nonnegative error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Peter Senna Tschudin --- drivers/video/savage/savagefb_driver.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/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 0d0f52c..f4f53b0 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c @@ -2266,8 +2266,10 @@ static int __devinit savagefb_probe(struct pci_dev* dev, lpitch = info->var.xres_virtual*((info->var.bits_per_pixel + 7) >> 3); info->var.yres_virtual = info->fix.smem_len/lpitch; - if (info->var.yres_virtual < info->var.yres) + if (info->var.yres_virtual < info->var.yres) { + err = -ENOMEM; goto failed; + } #if defined(CONFIG_FB_SAVAGE_ACCEL) /*