Skip to content

Commit 110ae8a

Browse files
Minghao Chisuperna9999
authored andcommitted
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 <[email protected]> Signed-off-by: Minghao Chi <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent d6cbe63 commit 110ae8a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev)
542542
if (ret < 0)
543543
return ret;
544544

545-
strlcpy(card->driver, DRIVER_NAME, sizeof(card->driver));
546-
strlcpy(card->shortname, "DW-HDMI", sizeof(card->shortname));
545+
strscpy(card->driver, DRIVER_NAME, sizeof(card->driver));
546+
strscpy(card->shortname, "DW-HDMI", sizeof(card->shortname));
547547
snprintf(card->longname, sizeof(card->longname),
548548
"%s rev 0x%02x, irq %d", card->shortname, revision,
549549
data->irq);
@@ -561,7 +561,7 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev)
561561

562562
dw->pcm = pcm;
563563
pcm->private_data = dw;
564-
strlcpy(pcm->name, DRIVER_NAME, sizeof(pcm->name));
564+
strscpy(pcm->name, DRIVER_NAME, sizeof(pcm->name));
565565
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_dw_hdmi_ops);
566566

567567
/*

0 commit comments

Comments
 (0)