Re: [PATCH] scsi: ufs: ufshcd-pltfrm: check the return value of kstrdup()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux