From patchwork Tue Apr 2 11:23:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmavathi Venna X-Patchwork-Id: 2377041 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 6966FDF2A1 for ; Tue, 2 Apr 2013 11:22:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753852Ab3DBLWr (ORCPT ); Tue, 2 Apr 2013 07:22:47 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:58805 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049Ab3DBLWq (ORCPT ); Tue, 2 Apr 2013 07:22:46 -0400 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MKM00KXVKXV17M0@mailout3.samsung.com> for linux-samsung-soc@vger.kernel.org; Tue, 02 Apr 2013 20:22:44 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.124]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id B8.14.02019.48FBA515; Tue, 02 Apr 2013 20:22:44 +0900 (KST) X-AuditID: cbfee690-b7f656d0000007e3-65-515abf848a16 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 17.10.13494.48FBA515; Tue, 02 Apr 2013 20:22:44 +0900 (KST) Received: from padma-linuxpc.sisodomain.com ([107.108.83.35]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MKM00C73KXQH650@mmp1.samsung.com>; Tue, 02 Apr 2013 20:22:44 +0900 (KST) From: Padmavathi Venna To: linux-samsung-soc@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, padma.v@samsung.com, padma.kvr@gmail.com Cc: sbkim73@samsung.com, broonie@opensource.wolfsonmicro.com, kgene.kim@samsung.com, Prathyush K Subject: [PATCH 1/2] ASoC: Samsung: return error if drvdata is not set Date: Tue, 02 Apr 2013 16:53:01 +0530 Message-id: <1364901782-16619-1-git-send-email-padma.v@samsung.com> X-Mailer: git-send-email 1.7.4.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFLMWRmVeSWpSXmKPExsWyRsSkRrdlf1SgweezehZXLh5isvg3+xSb Re+Cq2wWmx5fY7WYcX4fk0X7sjmsFr9vfmezuLBiI7vFxRVfmBw4PTZ8bmLz2DnrLrvH5iX1 Hi8n/mbz6NuyitHj8ya5ALYoLpuU1JzMstQifbsEroyX+7UL1rBXLJ1Y3sDYw9bFyMkhIWAi 8eTvHBYIW0ziwr31QHEuDiGBpYwS8z8cYoIpmtt5gxkisYhRYubm/awQTg+TxO+5C4FaODjY BHQkWs66gMRFBKYwSvzrW8IO0s0sUCNxbOYuVhBbWMBN4uT0dWBxFgFViTlrpzGD9PIKOEvM OyEAsUxB4tjUr2DzJQQms0ssu7SJDaJeQOLb5EMsIPUSArISmw4wQ9RLShxccYNlAqPgAkaG VYyiqQXJBcVJ6UUmesWJucWleel6yfm5mxiB4Xz637MJOxjvHbA+xJgMNG4is5Rocj4wHvJK 4g2NzYwsTE1MjY3MLc1IE1YS51VvsQ4UEkhPLEnNTk0tSC2KLyrNSS0+xMjEwSnVwCiet+a6 0FyZ3rZ5F2RjLyzqLGKy6DVWmHCIo+rwLs8FqpG5rVbPfc4uDrr1sfyNoYquieBVjbq386yX P8l9UKtnynegY6Ohrubu96VbNd5/SKyQ8srJkAtRuV/KsGP1ZKML/wVlmF/q15zKfNG1XkH1 l54Sp8wjqxOB2XsupP9/y70z9GogtxJLcUaioRZzUXEiAHk3LU19AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOIsWRmVeSWpSXmKPExsVy+t9jAd2W/VGBBotmqlhcuXiIyeLf7FNs Fr0LrrJZbHp8jdVixvl9TBbty+awWvy++Z3N4sKKjewWF1d8YXLg9NjwuYnNY+esu+wem5fU e7yc+JvNo2/LKkaPz5vkAtiiGhhtMlITU1KLFFLzkvNTMvPSbZW8g+Od403NDAx1DS0tzJUU 8hJzU22VXHwCdN0yc4CuUlIoS8wpBQoFJBYXK+nbYZoQGuKmawHTGKHrGxIE12NkgAYS1jBm vNyvXbCGvWLpxPIGxh62LkZODgkBE4m5nTeYIWwxiQv31gPFuTiEBBYxSszcvJ8Vwulhkvg9 dyFQhoODTUBHouWsC0hcRGAKo8S/viXsIN3MAjUSx2buYgWxhQXcJE5OXwcWZxFQlZizdhoz SC+vgLPEvBMCEMsUJI5N/co6gZF7ASPDKkbR1ILkguKk9FwjveLE3OLSvHS95PzcTYzgaHkm vYNxVYPFIUYBDkYlHl6HOZGBQqyJZcWVuYcYJTiYlUR443ZGBQrxpiRWVqUW5ccXleakFh9i TAZaPpFZSjQ5HxjJeSXxhsYm5qbGppYmFiZmlqQJK4nzHmy1DhQSSE8sSc1OTS1ILYLZwsTB KdXAqH438OGbzbybbZusLr7OtJp3iNfOX0h75q2DbmJczz/G5DSZJeyUYA2dcPVXwXcdrr91 NzRuSnkXzOydsXj1T8Ob8nMnTnh5ye7ZW9u7O+Z5azFt90iNkj6cGxfH/Xk7+/LvSz5v+rOl 1+LVvI6YvAkSNgv6v7VHltwo+Smz13fL+YdMV01ZDZVYijMSDbWYi4oTAT616mfaAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Prathyush K This patch fixes a possible crash in case drvdata for the secondary device is not set. Signed-off-by: Prathyush K Signed-off-by: Padmavathi Venna --- Based on Kukjin for-next branch sound/soc/samsung/i2s.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index d7231e3..f1fc064 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1107,6 +1107,10 @@ static int samsung_i2s_probe(struct platform_device *pdev) if (samsung_dai_type == TYPE_SEC) { sec_dai = dev_get_drvdata(&pdev->dev); + if (!sec_dai) { + dev_err(&pdev->dev, "Unable to get drvdata\n"); + return -EFAULT; + } snd_soc_register_dai(&sec_dai->pdev->dev, &sec_dai->i2s_dai_drv); asoc_dma_platform_register(&pdev->dev);