On 12/11/21 10:14, xkernel wrote:
kstrdup() can return NULL if some internal memory errors happen, so it is better to check the return value of it. Signed-off-by: xkernel <xkernel.wang@xxxxxxxxxxx>
Is xkernel the name of a person or the name of a robot? Patches should be signed by a person even if these have been generated by a robot.
+ clki->name = kstrdup(name, GFP_KERNEL); + if (!clki->name) { + ret = -ENOMEM; + devm_kfree(dev, clki); + goto out; + }
Is the devm_kfree() call necessary? Is it useful? Thanks, Bart.