From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756084AbcH1VkL (ORCPT ); Sun, 28 Aug 2016 17:40:11 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:54496 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751041AbcH1VkK (ORCPT ); Sun, 28 Aug 2016 17:40:10 -0400 X-IronPort-AV: E=Sophos;i="5.28,593,1464645600"; d="scan'208";a="191313700" Date: Sun, 28 Aug 2016 23:40:07 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Joe Perches cc: Nicolas Iooss , alsa-devel@alsa-project.org, Dan Capenter , Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org Subject: Re: Misuses of ** ? (was Re: [PATCH 1/1] ASoC: Intel: Atom: add a missing star in a memcpy call) In-Reply-To: <1472416453.26978.115.camel@perches.com> Message-ID: References: <20160828173945.27721-1-nicolas.iooss_linux@m4x.org> <1472406636.26978.95.camel@perches.com> <1472416453.26978.115.camel@perches.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1061404122-1472420311=:3419" Content-ID: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1061404122-1472420311=:3419 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-15 Content-Transfer-Encoding: 8BIT Content-ID: On Sun, 28 Aug 2016, Joe Perches wrote: > On Sun, 2016-08-28 at 21:38 +0200, Julia Lawall wrote: > > On Sun, 28 Aug 2016, Nicolas Iooss wrote: > > > On 28/08/16 19:50, Joe Perches wrote: > > > > On Sun, 2016-08-28 at 19:39 +0200, Nicolas Iooss wrote: > > > >> In sst_prepare_and_post_msg(), when a response is received in "block", > > > >> the following code gets executed: > > > >> > > > >>     *data = kzalloc(block->size, GFP_KERNEL); > > > >>     memcpy(data, (void *) block->data, block->size); > > > > > > > > Yuck, thanks. > > > > > > > > Julia, Dan, could cocci or smatch help find any other > > > > similar misuses here? > [] > > I tried the following semantic patch, that is quite general, and the fixed > > issue was the only report. > > > > @@ > > expression x,y,sz; > > identifier f,g; > > @@ > > > > * *x = f(sz,...); > >   ... > > * g(x,y,sz); > > Hi Julia, > > This would find exactly the same form, but I think > the question is are there assignments of a **pp > that should have been *pp > > Something like: > > @@ > type P; > P **pp; > @@ > > * pp = \|\|(..., sizeof(P), ...) I didn't get anything for this. Did you mean for the left hand side of the assignment to be pp or *pp? Is the issue that the type is wrong? julia --8323329-1061404122-1472420311=:3419--