Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2340663imm; Thu, 7 Jun 2018 09:03:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIGzT/IAKvYtZ8HiOTZ6blnDDriZCsvD0ftz2cAzJ5kr0H1PGyLLJj7Q5Egwc8IBHBHeS8N X-Received: by 2002:aa7:84cf:: with SMTP id x15-v6mr2315026pfn.220.1528387389719; Thu, 07 Jun 2018 09:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528387389; cv=none; d=google.com; s=arc-20160816; b=wA/d4NhZv5da9Mbv81Ia9e9aCfFEijOmpp1GlCoXxusuCiqgbgTquXWI+cDe42GRLu 8fEMU9VkztKKVO8CeScsIrbrgPFL/++gKMihnFVeSM6UM8C21mGLJAwEvtKjmzsvf5Cr j0ghDij29yl1TnZdW0YWYujgiYd8z+gzVCBtIeFe+UedJTaz4GtoISM8zfn7YYMEvVe4 2kOasKGbdDlTLQN0DeXFfFmohpwnOg+Nh3mAcmFNFS5aq3laHfFtIFQcJX4Ws7fMPoCB 4/fkcpvb8J0OQeILrp0AN8FvHIljP8Za52nVLbJYVpOz9xqfOQaREWsphNjip6rr+pVH mUPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=I+q/QyvcMp7XsUn5OgLOc7Y72r3ikTa2Tck67dJa+E0=; b=N0jpfauTD54BRGcdM1vex1KTqmEnLA/K4y86d+eg4ip+WZy1vcl1LgHIxp/vfHVpk+ wJtKUXFcpr+EmimUaboDZluWiQpbGYmdynXTZYbM7qFcxBm6gVN70BpDkAcwPky/ChUJ jg5IovqkDOBa1GhCfgXOYMdnq44e6VI2ew1Uj8rijMYY1hGTXUZa55oL/cRc+soj0jCn //+5/GJge6CN3q25BQawndXpGdO//kNMPRhV6/1AfUhzoioDug128zCuS/TiYmm7xgYw 4hfZ37cpTnrFaMAh9wlyMNWGr3Oemdap0kGDMVzJgl/8Dri0nlKfG5UgioVo0FUHFGoa vI+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9-v6si52148234pls.460.2018.06.07.09.02.52; Thu, 07 Jun 2018 09:03:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935754AbeFGQAq (ORCPT + 99 others); Thu, 7 Jun 2018 12:00:46 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:39286 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932870AbeFGOJE (ORCPT ); Thu, 7 Jun 2018 10:09:04 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvb4-0005Zk-Bd; Thu, 07 Jun 2018 15:09:02 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb0-0002oY-W2; Thu, 07 Jun 2018 15:08:58 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Nicolas Ferre" , "Tomi Valkeinen" , "Julia Lawall" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 091/410] drivers: video: fbdev: atmel_lcdfb.c: fix error return code In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Julia Lawall commit 6c131850eca653344c41d68ce87f3ab5a89af89e upstream. Convert a zero return value on error 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: Julia Lawall Acked-by: Nicolas Ferre Signed-off-by: Tomi Valkeinen Signed-off-by: Ben Hutchings --- drivers/video/fbdev/atmel_lcdfb.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c @@ -1101,12 +1101,14 @@ static int atmel_lcdfb_of_init(struct at timings = of_get_display_timings(display_np); if (!timings) { dev_err(dev, "failed to get display timings\n"); + ret = -EINVAL; goto put_display_node; } timings_np = of_find_node_by_name(display_np, "display-timings"); if (!timings_np) { dev_err(dev, "failed to find display-timings node\n"); + ret = -ENODEV; goto put_display_node; }