From: Trent Piepho Date: Fri, 27 Apr 2007 15:31:27 +0000 (-0300) Subject: V4L/DVB (5360): Dvb-pll: Use sizeof() to get name length X-Git-Tag: v2.6.22-rc1~1118^2~144 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=982dd1bdaab39185ccd55cafd3c099b7fee5f2dd;p=~emulex%2Finfiniband.git 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c index 62de760c844..43084bfc0f1 100644 --- a/drivers/media/dvb/frontends/dvb-pll.c +++ b/drivers/media/dvb/frontends/dvb-pll.c @@ -640,7 +640,8 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, memcpy(&fe->ops.tuner_ops, &dvb_pll_tuner_ops, sizeof(struct dvb_tuner_ops)); - strncpy(fe->ops.tuner_ops.info.name, desc->name, 128); + strncpy(fe->ops.tuner_ops.info.name, desc->name, + sizeof(fe->ops.tuner_ops.info.name)); fe->ops.tuner_ops.info.frequency_min = desc->min; fe->ops.tuner_ops.info.frequency_min = desc->max;