Message ID | alpine.DEB.2.22.394.2008091720080.2450@hadrien |
---|---|
State | New |
Headers | show |
Series | mmc: block: fix memdup.cocci warnings | expand |
--- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -1270,11 +1270,10 @@ static int mmc_blk_rpmb_set_dev_id(struc { char *id; - id = kmalloc(sizeof(card->raw_cid), GFP_KERNEL); + id = kmemdup(card->raw_cid, sizeof(card->raw_cid), GFP_KERNEL); if (!id) return -ENOMEM; - memcpy(id, card->raw_cid, sizeof(card->raw_cid)); ops->dev_id = id; ops->dev_id_len = sizeof(card->raw_cid);