Skip to content

Commit

Permalink
mmc: Use snprintf, not sprintf.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
JiebingLi authored and Chris Ball committed Oct 23, 2010
1 parent 53f3a9e commit 12578f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mmc/card/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 12578f6

Please sign in to comment.