Re: [PATCH v4] ALSA: hda/tas2781: Add speaker id check for ASUS projects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Wed, Nov 13, 2024 at 02:01:51PM +0100, Takashi Iwai wrote:
> On Mon, 04 Nov 2024 10:31:38 +0100,
> Baojun Xu wrote:
> > +	// Speaker id was needed for ASUS projects.
> > +	if (!strncmp(sub, TAS2781_ASUS_ID, sizeof(TAS2781_ASUS_ID))) {
> 
> Is this really correct?  The sizeof(TAS2781_ASUS_ID) is 5, including
> the terminating NUL.  So this becomes equivalent with strcmp(), and
> it doesn't check the sub-string.

It all depends to what that method returns. If it returns the exact string
then strcmp() is fine, if not, we should understand what it returns then.

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux