mmc: Use snprintf, not sprintf.
authorJiebingLi <jiebing.li@intel.com>
Thu, 17 Jun 2010 14:58:46 +0000 (15:58 +0100)
committerChris Ball <cjb@laptop.org>
Sat, 23 Oct 2010 13:11:11 +0000 (21:11 +0800)
Fix an issue found by klockwork. Just paranoia.

Signed-off-by: JiebingLi <jiebing.li@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/card/block.c

index 00073b7c036859ca199eb46caaed8476de82c23d..759a105cb21648b948b550f73118fb4940065a3e 100644 (file)
@@ -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);