Bug 11100 - nfs: Remove unnecessary NULL check before kfree()
Summary: nfs: Remove unnecessary NULL check before kfree()
Status: RESOLVED INVALID
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: fs (show other bugs) fs
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: Ferry Meng
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-26 20:02 UTC by HLjksuga
Modified: 2024-12-12 17:37 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description HLjksuga inspur_group 2024-09-26 20:02:31 UTC
Since kfree() already checks if its argument is NULL, an additional
    check before calling kfree() is unnecessary and can be removed.

    Remove it and thus also the following Coccinelle/coccicheck warning
    reported by ifnullfree.cocci:

      WARNING: NULL check before some freeing functions is not needed
Comment 1 Ferry Meng alibaba_cloud_group 2024-12-12 17:37:02 UTC
Would you mind initiating a PR to solve this? I have no idea which file contains this question.

I would mark this as Invalid, after you point the accurate code out or push PR, you can reopen it.