Skip to content

Commit

Permalink
rbd: use snprintf for disk->disk_name
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed May 24, 2011
1 parent 916d4d6 commit aedfec5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
if (!disk)
goto out;

sprintf(disk->disk_name, DRV_NAME "%d", rbd_dev->id);
snprintf(disk->disk_name, sizeof(disk->disk_name), DRV_NAME "%d",
rbd_dev->id);
disk->major = rbd_dev->major;
disk->first_minor = 0;
disk->fops = &rbd_bd_ops;
Expand Down

0 comments on commit aedfec5

Please sign in to comment.