[PATCH v7 03/14] ASoC: Intel: catpt: Add IPC message handlers

Andy Shevchenko andriy.shevchenko at linux.intel.com
Tue Sep 22 13:30:46 CEST 2020


On Tue, Sep 22, 2020 at 02:29:10PM +0300, Andy Shevchenko wrote:
> On Tue, Sep 22, 2020 at 11:04:31AM +0000, Rojewski, Cezary wrote:
> > On 2020-09-22 11:04 AM, Andy Shevchenko wrote:
> > > On Mon, Sep 21, 2020 at 08:48:12PM +0000, Rojewski, Cezary wrote:

...

> > > And here basically enough check is info against NULL, right?
> > > Just try to look at different possibilities how to make code simpler and neater.
> > > 
> > >> Didn't compile this, some typecheck fixes might be in order and so on.
> > > 
> > 
> > What you meant is:
> > 	if (i == 4 && !info) // instead of 'info < eof'
> > 
> > right?
> 
> Simply if (!info)...

	if (info)
		memcpy();

of course, otherwise it will crash.

> > If 4th space is last char in this string then info would end up being
> > non-NULL and equal to 'eof' and thus memcpy() would get invoked with
> > size=eof-info=0.
> 
> ...which is not a problem.

-- 
With Best Regards,
Andy Shevchenko




More information about the Alsa-devel mailing list