diff options
author | Minghao Chi <chi.minghao@zte.com.cn> | 2022-09-19 06:04:01 +0300 |
---|---|---|
committer | Neil Armstrong <neil.armstrong@linaro.org> | 2022-09-20 11:59:13 +0300 |
commit | 110ae8a21bbe779a133c1672a1463105c9d50590 (patch) | |
tree | 0b280077df340409debf6785a26ee001844beb36 | |
parent | d6cbe630f3e9a5b11ba4082ff980ccc094224610 (diff) | |
download | linux-110ae8a21bbe779a133c1672a1463105c9d50590.tar.xz |
drm: bridge/dw-hdmi-ahb-audio: use strscpy() is more robust and safer
The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL terminated strings.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220919030401.211331-1-chi.minghao@zte.com.cn
-rw-r--r-- | drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c index 7d2ed0ed2fe2..4efb62bcdb63 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c @@ -542,8 +542,8 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev) if (ret < 0) return ret; - strlcpy(card->driver, DRIVER_NAME, sizeof(card->driver)); - strlcpy(card->shortname, "DW-HDMI", sizeof(card->shortname)); + strscpy(card->driver, DRIVER_NAME, sizeof(card->driver)); + strscpy(card->shortname, "DW-HDMI", sizeof(card->shortname)); snprintf(card->longname, sizeof(card->longname), "%s rev 0x%02x, irq %d", card->shortname, revision, data->irq); @@ -561,7 +561,7 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev) dw->pcm = pcm; pcm->private_data = dw; - strlcpy(pcm->name, DRIVER_NAME, sizeof(pcm->name)); + strscpy(pcm->name, DRIVER_NAME, sizeof(pcm->name)); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_dw_hdmi_ops); /* |