Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (5360): Dvb-pll: Use sizeof() to get name length

Better to use sizeof() to get the size of the output buffer for the tuner
name, instead of just hard coding 128.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by

Trent Piepho and committed by
Mauro Carvalho Chehab
982dd1bd 51dec1f1

+2 -1
+2 -1
drivers/media/dvb/frontends/dvb-pll.c
··· 640 640 memcpy(&fe->ops.tuner_ops, &dvb_pll_tuner_ops, 641 641 sizeof(struct dvb_tuner_ops)); 642 642 643 - strncpy(fe->ops.tuner_ops.info.name, desc->name, 128); 643 + strncpy(fe->ops.tuner_ops.info.name, desc->name, 644 + sizeof(fe->ops.tuner_ops.info.name)); 644 645 fe->ops.tuner_ops.info.frequency_min = desc->min; 645 646 fe->ops.tuner_ops.info.frequency_min = desc->max; 646 647