Re: [PATCH v3] drivers/misc: Add NULL check in aspeed_lpc_enable_snoop

From: Markus Elfring
Date: Mon Mar 31 2025 - 12:16:03 EST


> devm_kasprintf() returns NULL if memory allocation fails. Currently,

call? failed?


> The corrected code adds error checking and optimizes resource release logic


See also once more:
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.14#n94


An other subsystem specification might be more desirable.
https://web.git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/drivers/soc/aspeed/aspeed-lpc-snoop.c?h=next-20250331


* May the array access be simplified another bit here?
* How do you think about to store a pointer to a corresponding data structure member
in an additional local variable?


Regards,
Markus