lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 16 Aug 2022 11:57:31 +0200
From:   Takashi Iwai <tiwai@...e.de>
To:     zhaoxiao <zhaoxiao@...ontech.com>
Cc:     perex@...ex.cz, tiwai@...e.com,
        pierre-louis.bossart@...ux.intel.com, lgirdwood@...il.com,
        peter.ujfalusi@...ux.intel.com, yung-chuan.liao@...ux.intel.com,
        ranjani.sridharan@...ux.intel.com, kai.vehmanen@...ux.intel.com,
        daniel.baluta@....com, broonie@...nel.org,
        guennadi.liakhovetski@...ux.intel.com,
        sound-open-firmware@...a-project.org, alsa-devel@...a-project.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: intel: Replace scnprintf() calls with sysfs_emit_at()

On Tue, 16 Aug 2022 10:55:02 +0200,
zhaoxiao wrote:
> 
> For sysfs outputs, it's safer to use a new helper, sysfs_emit(),
> instead of the raw sprintf() & co.  This patch replaces the open-code
> with a new helper, sysfs_emit_at(), by passing the string offset.

Well, the function you've changed isn't used for sysfs at all...


Takashi

> 
> Signed-off-by: zhaoxiao <zhaoxiao@...ontech.com>
> ---
>  sound/soc/sof/intel/hda.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
> index 6d4ecbe14adf..917d639671a7 100644
> --- a/sound/soc/sof/intel/hda.c
> +++ b/sound/soc/sof/intel/hda.c
> @@ -574,7 +574,7 @@ static void hda_dsp_dump_ext_rom_status(struct snd_sof_dev *sdev, const char *le
>  	chip = get_chip_info(sdev->pdata);
>  	for (i = 0; i < HDA_EXT_ROM_STATUS_SIZE; i++) {
>  		value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg + i * 0x4);
> -		len += scnprintf(msg + len, sizeof(msg) - len, " 0x%x", value);
> +		len += sysfs_emit_at(msg, len, " 0x%x", value);
>  	}
>  
>  	dev_printk(level, sdev->dev, "extended rom status: %s", msg);
> -- 
> 2.20.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ