From: JiebingLi Date: Thu, 17 Jun 2010 14:58:46 +0000 (+0100) Subject: mmc: Use snprintf, not sprintf. X-Git-Tag: firefly_0821_release~7613^2~3588^2~60 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=12578f66b9058e63f193fbfe1552e1d1bfa361bb;p=firefly-linux-kernel-4.4.55.git mmc: Use snprintf, not sprintf. Fix an issue found by klockwork. Just paranoia. Signed-off-by: JiebingLi Signed-off-by: Alan Cox Cc: Signed-off-by: Andrew Morton Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 00073b7c0368..759a105cb216 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -620,7 +620,8 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) * messages to tell when the card is present. */ - sprintf(md->disk->disk_name, "mmcblk%d", devidx); + snprintf(md->disk->disk_name, sizeof(md->disk->disk_name), + "mmcblk%d", devidx); blk_queue_logical_block_size(md->queue.queue, 512);