Re: [PATCH v3] i2c: cp2615: handle allocation failure
From: Markus Elfring
Date: Sun Sep 06 2026 - 14:14:14 EST
> Check the result of kzalloc_obj() and return -ENOMEM
> when the allocation fails instead of passing a NULL pointer
> to the message initialization helpers, which would return -EINVAL.
>
> Also separate kzalloc_obj() calls from variable declarations.
* Can such a source code adjustment relieve further development concerns?
https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/expressions-exp/exp34-c/
* How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.3-rc1#n198
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v7.3-rc1#n3
* How do you think about to increase the application of scope-based resource management?
Regards,
Markus