when some other buffer is immediately copied into allocated region.
Replace calls to kmalloc followed by a memcpy with a direct
call to kmemdup.
Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
        struct sockaddr *addr;
        struct scatterlist sg;
 
-       addr = kmalloc(sizeof(*addr), GFP_KERNEL);
+       addr = kmemdup(p, sizeof(*addr), GFP_KERNEL);
        if (!addr)
                return -ENOMEM;
-       memcpy(addr, p, sizeof(*addr));
 
        ret = eth_prepare_mac_addr_change(dev, addr);
        if (ret)