Received: by 10.223.164.202 with SMTP id h10csp1033072wrb; Fri, 17 Nov 2017 12:44:05 -0800 (PST) X-Google-Smtp-Source: AGs4zMZAD/Vvgq7fCZxU9QwFKaALQOUFooYofXGLJOCQtOniQ9vTYUG691ngJOEPOjUjMzpyWw5H X-Received: by 10.84.128.197 with SMTP id a63mr6400947pla.210.1510951445211; Fri, 17 Nov 2017 12:44:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510951445; cv=none; d=google.com; s=arc-20160816; b=mGYbRmnRJvzgHvhRYaYKXy9PPWSSC7RSVWNa18LtzY4c1RHDjrP/C7smNhlS7yII6w lCtnRRdY/YW2K4Lye1GgbUp208IVBBPx9thXpqutk7aYyetI5UG623bRFi9qs+0AvEkV dwp0UNYbzqyPWVH6D459tkf1nF6rciw302ZA9XPaYrYE3oSzriElsNINrFl0EbOEAZYY /C/T+/GL9jsvIgQghQup5Yme4vm2sBW1J9ENSYz60/6Cjdt4dYlVu98Vtrb4yFSm7u+n 1tRHDh+mGVNyL1+ggSiHzmgyznh5YosefknlXezPW+70RYWBMFTBLP1QjYjrOgkAJWUj bxEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=L0HnodJL+8AFT4nm+2VCjx5WAgmh5JRDV+x93a4n7PM=; b=JA/szgqHXfXdgrM7yzx2uZrxUTEcJnmuGZbdRxKQebHpwzbjISGkiw2sizyP8HcBDw B9ZFrAUKRm1zmjJ8kS/YFy3flK7PckU5Zq0FkbYtZFxIJaz1SPXw2KSAR+NmFrs2tAU/ Xn3qDtIrop6aJUiyt6gRU7EjR04PZ1YKRSywUXN8fEy0316e2TudspG/hwzhJbppwci8 kAkJRcAcfwvwjRot2gviA9rltNZVYjF13jBnhX12NEGOgEu6KPa3oRH90B1vnhI5YzhL L8X4oMex+vlTMrIkrFA09Bj/ifkS/jYiomgMKLeWqnEdX5aBPieQsMSZ7HTCCceIQ6Tq jh3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=noEJq4TO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v63si3667769pfk.405.2017.11.17.12.43.52; Fri, 17 Nov 2017 12:44:05 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=noEJq4TO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759422AbdKQRDp (ORCPT + 93 others); Fri, 17 Nov 2017 12:03:45 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34709 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751425AbdKQRDk (ORCPT ); Fri, 17 Nov 2017 12:03:40 -0500 Received: by mail-pg0-f67.google.com with SMTP id 4so2380194pge.1 for ; Fri, 17 Nov 2017 09:03:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=L0HnodJL+8AFT4nm+2VCjx5WAgmh5JRDV+x93a4n7PM=; b=noEJq4TO5DoROREAULbmByHNFnQXCDK3DuLaB33o9EDSJKTvPGjErcoXGBhcJvb8rg JYx0afJCvLOZFBP6nHUcjwS42DjhSf88RCvtE0RLfQxJGbr7HKvd/8PlWj+vcmkj2Mpj e+Yz6f/+WraTXU/6ygVfx9PC9D5C94r3p4xgbeNhLBbjKViMvOAn3e+Pnp8FQVBtVt9e hhbp1EoNUr4YRV72sQ5Mfg5ZYOcq6U2HHy4HoX82M8UqO6yrBmWSveRWEZZPBP1nIG8k zlyyKIqWwpRTvIUbZDPBy7S602F0NPdZVRpDIvm1DNNXSpur51IbuikCkBfZm5jyrcZi hVaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=L0HnodJL+8AFT4nm+2VCjx5WAgmh5JRDV+x93a4n7PM=; b=pXJPMI0NfKu//CdHjW2Yy/ncxmPG7ttYQaLETIYc57rJupbjWee+TftFYuAqAx9vdG /sQdpyc/MJ/SHS2UTQYaVytw/dz41LiiHRA7ApRJr2a3Egoj89Rcz/mMYpqHHo8YM3oC 0xeL8Xhs0CWQeJUq9+vB5x/6GsZ+i33R+sJiszG2W5x5fMeBqM/fRJqK/FKyrFm+EPVY zQMJnPS2j1lm5Zvryxdym2ZI1jyjrjRXP+2E4nIFSLuMBJX2tF9qvRUFGU99PUn6fUdg Um2Pv15lVfBR82wHpd6s60UE+ItrtkzwrOTj6cWD263fMZVNLRQUIe1NVpmi4R+2aUfb ofEA== X-Gm-Message-State: AJaThX6pQAfgnigeOj4zoy42XRN37nVyphMKDA0ZK5gq8o3/nx/Rifne LRiNRmri0THsOW2xac/kztiucQ== X-Received: by 10.84.216.29 with SMTP id m29mr5823501pli.243.1510938219387; Fri, 17 Nov 2017 09:03:39 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id q12sm7282265pgn.56.2017.11.17.09.03.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 09:03:38 -0800 (PST) From: Arvind Yadav To: f.fainelli@gmail.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2] vlynq : Handle return value of platform_get_irq_byname and vlynq_probe Date: Fri, 17 Nov 2017 22:33:25 +0530 Message-Id: <292644d8f55e267488e1e7362ec2cf4b6ea95d2f.1510937831.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org platform_get_irq_byname() can fail here and we must check its return value. device_register() can fail here, initialised 'result' variable beforen'goto fail_register' otherwise vlynq_probe will return uninitialised 'result' variable. Signed-off-by: Arvind Yadav --- changes in v2 : return device_register() value insted of -ENXIO. drivers/vlynq/vlynq.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/vlynq/vlynq.c b/drivers/vlynq/vlynq.c index c0227f9..a200ff0 100644 --- a/drivers/vlynq/vlynq.c +++ b/drivers/vlynq/vlynq.c @@ -722,13 +722,19 @@ static int vlynq_probe(struct platform_device *pdev) VLYNQ_REMOTE_OFFSET); dev->irq = platform_get_irq_byname(pdev, "irq"); + if (dev->irq < 0) { + result = dev->irq; + goto fail_register; + } dev->irq_start = irq_res->start; dev->irq_end = irq_res->end; dev->local_irq = dev->irq_end - dev->irq_start; dev->remote_irq = dev->local_irq - 1; - if (device_register(&dev->dev)) + result = device_register(&dev->dev); + if (result) goto fail_register; + platform_set_drvdata(pdev, dev); printk(KERN_INFO "%s: regs 0x%p, irq %d, mem 0x%p\n", -- 2.7.4 From 1584466931646067747@xxx Sun Nov 19 04:23:37 +0000 2017 X-GM-THRID: 1584377582657647724 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread