On Fri, 2018-05-18 at 10:56 +0200, Arend van Spriel wrote: > > > + buffer = kmalloc(sizeof(cmd), GFP_KERNEL); > > + if (!buffer) > > + return -ENOMEM; > > + memcpy(buffer, cmd, sizeof(cmd)); It should also use kmemdup() ;-) johannes
On Fri, 2018-05-18 at 10:56 +0200, Arend van Spriel wrote: > > > + buffer = kmalloc(sizeof(cmd), GFP_KERNEL); > > + if (!buffer) > > + return -ENOMEM; > > + memcpy(buffer, cmd, sizeof(cmd)); It should also use kmemdup() ;-) johannes