On Sat, Jan 29, 2022 at 8:59 AM Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> wrote: > > It's up to you all, if you think the patch is correct, keep it for now. In the fixed form (ie with Damien's fix for the wrong test polarity), it's certainly not wrong, and matches a lot of our standard patterns - including our documentation in Documentation/driver-api/driver-model/design-patterns.rst I did a quick visual grep, and all the cases of devm_kzalloc(..GFP_KERNEL) I grepped for did indeed have that "if (!..)" error handling pattern for the return value, including other cases in the ATA subsystem. That was very much a "quick visual grep" though, so no guarantees, and I stopped looking after it was so obvious. IOW, it was just a git grep -1 devm_kzalloc.*GFP_KERNEL and then looking at the output and saying "yup, they all seem to do that allocation failure test". At the same time it's certainly also true that a small devm_kzalloc() using GFP_KERNEL should never actually fail, so the patch - while looking very correct to me - almost certainly makes no difference in practice. So I think the only problem with the patch is the original (fixed) bug, and the source it came from. Linus