Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752997AbdHKNAd (ORCPT ); Fri, 11 Aug 2017 09:00:33 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:58411 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752765AbdHKNAb (ORCPT ); Fri, 11 Aug 2017 09:00:31 -0400 X-AuditID: b6c32a47-f79db6d000003732-5d-598daa6c4773 Subject: Re: [PATCH v2] ASoC: samsung: i2s: Null pointer dereference on samsung_i2s_remove To: Anton Vasilyev Cc: Krzysztof Kozlowski , Sangbeom Kim , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org From: Sylwester Nawrocki Message-id: <029a9c75-b8ca-1969-d846-fb49c4bc41bf@samsung.com> Date: Fri, 11 Aug 2017 15:00:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-version: 1.0 In-reply-to: <1502454942-739-1-git-send-email-vasilyev@ispras.ru> Content-type: text/plain; charset="utf-8"; format="flowed" Content-language: en-GB Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLKsWRmVeSWpSXmKPExsWy7bCmqW7Oqt5IgzOzhCyuXDzEZDH14RM2 i/PnN7BbLO/uYrH4dqWDyeLyrjlsFp27+lktLq74wmSx4ftaRovu+TkOXB4bPjexeeycdZfd Y8a/qYwem1Z1snncef2X1WPf22VsHn1bVjF6rN9ylcXj8ya5AM4oLpuU1JzMstQifbsErozf 92ewFexmqeiefI2pgfE2cxcjJ4eEgIlE7/PHLBC2mMSFe+vZuhi5OIQEdjBKfH76FqxISOAz o8TqFcEwDYc71zHCFf1btIEVwrnPKNG7cyo7SJWwQIxE++YXYN0iAuoSUx80gdnMAluZJH7/ ZQSx2QQMJXqP9oHZvAJ2En+WzGYFsVk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E39vL7BA1ghI/Jt9jAbE5BRwlGm/chVpgJvHl5WFWCFtc4tj9m4wQtrzE 5jVvmScwCs5C0j4LScssJC2zkLQsYGRZxSiWWlCcm55bbFRgpFecmFtcmpeul5yfu4kRGNfb DmsF7GBsOhd9iFGAg1GJh9fjUE+kEGtiWXFl7iFGCQ5mJRHevct6I4V4UxIrq1KL8uOLSnNS iw8xmgK9N5FZSjQ5H5hy8kriDU0sjUwMzMwMjQyMzZTEeScEfokQEkhPLEnNTk0tSC2C6WPi 4JRqYJxqurarvIDvRPHXuQm2V28GKDey6J3p2V5YVS6TVrN4x/FpajyOuun7n65cGLJq98UJ k2bcNXmrpd+6tOW5jWgWj2FkqoxOVLIcuwqzTPmenhW13AZ7CsV+ShS/3Xrtg9Xdovf9os4N 7Il/OyXb5/QE/hC3XXu20bqS6ZdR79/beYssbTWDlViKMxINtZiLihMBrdNo1gEDAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170811130027epcas2p1eab3ca7acc971565e889a56fba223228 X-Msg-Generator: CA X-Sender-IP: 182.195.42.80 X-Local-Sender: =?UTF-8?B?U3lsd2VzdGVyIE5hd3JvY2tpG1NSUE9MLUtlcm5lbCAoVFAp?= =?UTF-8?B?G+yCvOyEseyghOyekBtTZW5pb3IgU29mdHdhcmUgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?U3lsd2VzdGVyIE5hd3JvY2tpG1NSUE9MLUtlcm5lbCAoVFAp?= =?UTF-8?B?G1NhbXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIFNvZnR3YXJlIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 102P X-CMS-RootMailID: 20170811123601epcas4p49ca200aaa39cae3fa0f6cba5bf86f1f8 X-RootMTR: 20170811123601epcas4p49ca200aaa39cae3fa0f6cba5bf86f1f8 References: <1502454942-739-1-git-send-email-vasilyev@ispras.ru> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 554 Lines: 15 On 08/11/2017 02:35 PM, Anton Vasilyev wrote: > If (quirks & QUIRK_SEC_DAI == 0) then samsung_i2s_probe() doesn't allocate > sec_dai and pri_dai->sec_dai remains Null, but samsung_i2s_remove() > permorms pri_dai->sec_dai dereference in any case. ^^^^^^^^ Still you have a typo here. ;) > The patch adds sec_dai check on Null before derefence at > samsung_i2s_remove(). > > Found by Linux Driver Verification project (linuxtesting.org). > > Signed-off-by: Anton Vasilyev Reviewed-by: Sylwester Nawrocki