Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp119541ybi; Fri, 26 Jul 2019 07:04:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcu8j5Gig2Og3cSvP5xuFSODYu3R3uxws8d4KtQrDy0dFnHxDcG0WBbz9qbYKOKKX+Ptuj X-Received: by 2002:a17:90b:8d8:: with SMTP id ds24mr22283390pjb.135.1564149889151; Fri, 26 Jul 2019 07:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564149889; cv=none; d=google.com; s=arc-20160816; b=Xh8iN0S7q+PmSLJsRCfLbOCMzgSzZgTOurhZUuJwTjy9F3YxVtUolcDHEtLaKG5j/g ZEbe6uFldo9LhbHgqIhHK0D2RKQAhMipbXcCWQ0a0H22MxQUfDpsHU87EbivdBCtv9Kx T/07FJg473N4Fh8ZSxKnQGdfLpmf3zakR4LAuR7BytTtERWlDXw1/P2g33LEo8dNEMQx qfp+alTbsVCZ5u0Rp45qW3Ktf1FIQdRaD0CRH7lYd09jjeAbbvKcHLMyosxLIyCxDmad 3QACJOkwQKwUYNKpUXhM8u3b59V0SRgRYTlsqJun9yFjokRUOX5yGD1ZUwWm+KQ1+Ha8 Tl6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=6X0iHLG7qpEWuAO8Gb3r27GUqVJlNAinIZ6m2oQQ2lI=; b=fFYAhFU1valivS68+LlZApXxdOhvVKs8fpfSUgWsAL/nbqlp9u9vyVnP+3zlMfsdtJ h9IR2KrvpduGSacsAKrv7Qr/Fl2Jz0zcPJ2N1GVyTYrrUpQlcFl70pWecDJIkCxtBo6s zSxjBsmB/3txLOjlT1VnR4ukZHVm9XFbSCYPJOYpaog1Bt7v/0F8AvCLZarcRPddtjyi beqcHwgTDmgsEF3ABAUK91CAt/oOqJLxpYkdbqhLc46W+5z+yPWca/OAai8nUZgXWwgc I4y710X7GcuMlE1NJBTvNGvzERJv44QhPN5myLxFUd9cubPnWC6UGBDioKAshG5SuSdl 5ipA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m22si19988526pgh.190.2019.07.26.07.04.16; Fri, 26 Jul 2019 07:04:49 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727716AbfGZOCc (ORCPT + 99 others); Fri, 26 Jul 2019 10:02:32 -0400 Received: from mga09.intel.com ([134.134.136.24]:50221 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726857AbfGZOCc (ORCPT ); Fri, 26 Jul 2019 10:02:32 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2019 07:02:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,311,1559545200"; d="scan'208";a="322047360" Received: from msmall-mobl.amr.corp.intel.com (HELO [10.251.154.62]) ([10.251.154.62]) by orsmga004.jf.intel.com with ESMTP; 26 Jul 2019 07:02:30 -0700 Subject: Re: [alsa-devel] [RFC PATCH 06/40] soundwire: intel: prevent possible dereference in hw_params To: Cezary Rojewski Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, vkoul@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Sanyog Kale References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-7-pierre-louis.bossart@linux.intel.com> <1e814ab9-9606-88a5-3181-6cdb203671c3@intel.com> From: Pierre-Louis Bossart Message-ID: Date: Fri, 26 Jul 2019 09:02:30 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1e814ab9-9606-88a5-3181-6cdb203671c3@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c >> index 68832e613b1e..497879dd9c0d 100644 >> --- a/drivers/soundwire/intel.c >> +++ b/drivers/soundwire/intel.c >> @@ -509,7 +509,7 @@ static int intel_config_stream(struct sdw_intel *sdw, >>                      struct snd_soc_dai *dai, >>                      struct snd_pcm_hw_params *hw_params, int link_id) >>   { >> -    if (sdw->res->ops && sdw->res->ops->config_stream) >> +    if (sdw->res->ops && sdw->res->ops->config_stream && sdw->res->arg) >>           return sdw->res->ops->config_stream(sdw->res->arg, >>                   substream, dai, hw_params, link_id); >> > > Hmm, declaring local for sdw->res should prove useful here after > addition of 4th sdw->res dereference. yes, it's an eyesore. I added this to quickly fix a kernel oops while debugging, will simplify. thanks for the note.