Message ID | 1462519504-3092-1-git-send-email-k.kozlowski@samsung.com |
---|---|
State | Not Applicable |
Headers | show
Return-Path: <rtc-linux+bncBDKZNNNLXAHBBX4NWG4QKGQEBZ5IPHI@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-qg0-x23b.google.com (mail-qg0-x23b.google.com [IPv6:2607:f8b0:400d:c04::23b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r1NbP5Rcrz9s2k for <incoming@patchwork.ozlabs.org>; Fri, 6 May 2016 17:25:21 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b=Nl4s9c/j; dkim-atps=neutral Received: by mail-qg0-x23b.google.com with SMTP id f74sf21440933qge.1 for <incoming@patchwork.ozlabs.org>; Fri, 06 May 2016 00:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=nj223AhiLAhIa8iXT7DvrxGUmGpfNNoDE7zGQxYCdIg=; b=Nl4s9c/jDRToIyVuUgM9//3EpJCX8P3Z9kposxi6r6dvprbG9JtfJ1L9o0USy0C2YV 4xvrSctkCOlZ0vQFOv8mhHqsLnPmkoxuTnb3yebChQBdOhaofP6vDW3Qfy7DwqNAmKLh NbE5eQJAKgEwPFlG9jjDtHfZqPSZbxYN2CWp+qqmATq3CHW0RpWTldClvkY1GfsVMeL+ NLj59UIyyViKCSIBf5tAQXVDl8vx+dZOoGxPMVi3p8WkO2deBPZg0VwlJ8tRy/bejo9c YpcjvEjSqZby41zyUmQzoUA7WjpYgwOYfLySGtMkPcWbVYV02XUrhVowdkjZnOkSoIKe z2Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=nj223AhiLAhIa8iXT7DvrxGUmGpfNNoDE7zGQxYCdIg=; b=l43cWNJASs/KfvE2k4k+bK8ZfoC+6BXaM4nCzJcDXIBWQNzIpfpyhI1UAiKybpUnRk 40b6H2rZpwLHMJfqOvPogpxBJVU6aFbcgvM4iqMovQM1TdB5Ny8Pl0WdBS+Dej6+j1iW dPsWCAQWAgKJSZF7nHenajo8UBqasNR3xDIbC/LnbYRDGGQMoliMNjHwJFtVRWB56TNA XHRAdZZP/ZhdE/6bXU2SlCgxDd3CCGgIr5kUZcs0zdtjlHbVFa75a62SlRuFH205MVnl sa3BUK/zVXt5DhAKOzwxSRWtZVqQm50thGBe8LBmz4iPd6OBz6SMTKHyxlFZbjIh5ZNV M56Q== Sender: rtc-linux@googlegroups.com X-Gm-Message-State: AOPr4FX+dNdbgwDVVFwvd4DcKgraHl+9aBaisJA0ZiQAw65GkO9BA0eSJJI55F9b/P5lsA== X-Received: by 10.140.93.45 with SMTP id c42mr590903qge.5.1462519519809; Fri, 06 May 2016 00:25:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.140.42.20 with SMTP id b20ls2181455qga.6.gmail; Fri, 06 May 2016 00:25:19 -0700 (PDT) X-Received: by 10.129.79.201 with SMTP id d192mr12099283ywb.0.1462519519526; Fri, 06 May 2016 00:25:19 -0700 (PDT) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com. [210.118.77.11]) by gmr-mx.google.com with ESMTPS id 22si2729321pfv.2.2016.05.06.00.25.19 for <rtc-linux@googlegroups.com> (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 06 May 2016 00:25:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of k.kozlowski@samsung.com designates 210.118.77.11 as permitted sender) client-ip=210.118.77.11; Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O6Q00DG5VA35Q80@mailout1.w1.samsung.com> for rtc-linux@googlegroups.com; Fri, 06 May 2016 08:25:15 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-cc-572c46db8ad6 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id E5.8E.04866.BD64C275; Fri, 6 May 2016 08:25:15 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O6Q00AUIV9W5150@eusync3.samsung.com>; Fri, 06 May 2016 08:25:15 +0100 (BST) From: Krzysztof Kozlowski <k.kozlowski@samsung.com> To: Kukjin Kim <kgene@kernel.org>, Krzysztof Kozlowski <k.kozlowski@samsung.com>, MyungJoo Ham <myungjoo.ham@samsung.com>, Chanwoo Choi <cw00.choi@samsung.com>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, Richard Purdie <rpurdie@rpsys.net>, Jacek Anaszewski <j.anaszewski@samsung.com>, Lee Jones <lee.jones@linaro.org>, Sebastian Reichel <sre@kernel.org>, Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>, David Woodhouse <dwmw2@infradead.org>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Alessandro Zummo <a.zummo@towertech.it>, Alexandre Belloni <alexandre.belloni@free-electrons.com>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-pm@vger.kernel.org, rtc-linux@googlegroups.com Cc: r.baldyga@hackerion.com, Marek Szyprowski <m.szyprowski@samsung.com>, stable@vger.kernel.org, Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Subject: [rtc-linux] [PATCH v6 1/9] input: max8997-haptic: Fix NULL pointer dereference Date: Fri, 06 May 2016 09:24:56 +0200 Message-id: <1462519504-3092-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1462519289-2356-2-git-send-email-k.kozlowski@samsung.com> References: <1462519289-2356-2-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBIsWRmVeSWpSXmKPExsVy+t/xq7q33XTCDTbNU7ZYcvEqu0XHtcVM FhtnrGe1mPrwCZvF9S/PWS0mPXnPbDH/yDlWi8OLXjBaTFw5mdmi9+pzRovXLwwt+h+/Zra4 //Uoo8W3Kx1MFpseX2O1uPnpG6vF5V1z2Cy2vlnHaPG59wijxYzz+5gs1h65y25xu3EFm8Xd f58YLXbvespqsb+zg9Hi9O4SiwUbHzE6SHs82XSR0WPnrLvsHnsmnmTzOLLzGJvH5hVaHptW dbJ53Lm2B8hbUu+xZ/4PVo++LasYPabP+8nk8XmTXABPFJdNSmpOZllqkb5dAlfG1tPzGAvu CVV8vnOHqYFxmkAXIyeHhICJxM4HR1ggbDGJC/fWs3UxcnEICSxllPjc8Yodwmlkkvi87A0z SBWbgLHE5uVLwKpEBD6ySVx+/4wRxGEWmMEosfn+WnaQKmEBb4n3KzaAdbAIqEr0vW8H2sHB wSvgJvG8IxJinZzEyWOTWUFsTgF3iTkP54OdIQRUsvD+L8YJjLwLGBlWMYqmliYXFCel5xrp FSfmFpfmpesl5+duYoTE19cdjEuPWR1iFOBgVOLhzTipHS7EmlhWXJl7iFGCg1lJhNfPRSdc iDclsbIqtSg/vqg0J7X4EKM0B4uSOO/MXe9DhATSE0tSs1NTC1KLYLJMHJxSDYxW0lrydzUy Nk59YaEivdcnfvLEWhMlfXYvizeXuHb+8Lz4OoD5oXZRsP0cdvOLB/0Y1Y4nVTXcKLkwf/+E CXz/nGoC9q9ZuflQ6A2V5+vkHzcb2cpUc+Vp8vMqpG+0mvLU4tzs/08uL14cWGOlGfrBTE7r kH/Qtq73e15eiOqaNnniac978aVKLMUZiYZazEXFiQCQt76OqwIAAA== X-Original-Sender: k.kozlowski@samsung.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of k.kozlowski@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=k.kozlowski@samsung.com Reply-To: rtc-linux@googlegroups.com Content-Type: text/plain; charset=UTF-8 Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: <rtc-linux.googlegroups.com> X-Spam-Checked-In-Group: rtc-linux@googlegroups.com X-Google-Group-Id: 712029733259 List-Post: <https://groups.google.com/group/rtc-linux/post>, <mailto:rtc-linux@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:rtc-linux+help@googlegroups.com> List-Archive: <https://groups.google.com/group/rtc-linux List-Subscribe: <https://groups.google.com/group/rtc-linux/subscribe>, <mailto:rtc-linux+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+712029733259+unsubscribe@googlegroups.com>, <https://groups.google.com/group/rtc-linux/subscribe> |
diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c index a806ba3818f7..8d6326d7e7be 100644 --- a/drivers/input/misc/max8997_haptic.c +++ b/drivers/input/misc/max8997_haptic.c @@ -255,12 +255,14 @@ static int max8997_haptic_probe(struct platform_device *pdev) struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent); const struct max8997_platform_data *pdata = dev_get_platdata(iodev->dev); - const struct max8997_haptic_platform_data *haptic_pdata = - pdata->haptic_pdata; + const struct max8997_haptic_platform_data *haptic_pdata = NULL; struct max8997_haptic *chip; struct input_dev *input_dev; int error; + if (pdata) + haptic_pdata = pdata->haptic_pdata; + if (!haptic_pdata) { dev_err(&pdev->dev, "no haptic platform data\n"); return -EINVAL;