Question about printking

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

 



Hello,

I have a quick question.
I (think I) remember Greg KH reviewing some driver patch on staging
mailing list,
suggesting not to do this sort of printking upon an allocation request failure:

ptr = kmalloc(sizeof(foo));
if (!ptr) {
        pr_err("Cannot allocate memory for foo\n");
        return -ENOMEM;
}

His argue against it was that kmalloc already takes care of reporting/printking
a good deal of interesting information when this happens.

Is my memory right?

Can someone expand a bit on this whole idea? (of abuse of printing,
or futility of printing).

I'm asking after seeing *a lot* of drivers doing exactly this.

Thanks,

--
    Ezequiel

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux