Re: [PATCH 3.16 232/366] tracing: Deletion of an unnecessary check before iput()

From: Ben Hutchings
Date: Sun Oct 14 2018 - 14:06:09 EST


On Sun, 2018-10-14 at 10:24 -0700, Joe Perches wrote:
> On Sun, 2018-10-14 at 16:25 +0100, Ben Hutchings wrote:
> > 3.16.60-rc1 review patch. If anyone has any objections, please let me know.
>
> I believe that no stable or backport kernel needs to
> apply patches like this unless it's needed for other
> real patches to be applied more easily.

This is only included so I could apply commit 0c92c7a3c5d4 "tracing:
Fix bad use of igrab in trace_uprobe.c" with fewer changes.

Ben.

> > ------------------
> >
> > From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> >
> > commit 16a8ef2751801346f1f76a18685b2beb63cd170f upstream.
> >
> > The iput() function tests whether its argument is NULL and then
> > returns immediately. Thus the test around the call is not needed.
> >
> > This issue was detected by using the Coccinelle software.
> >
> > Link: http://lkml.kernel.org/r/5468F875.7080907@xxxxxxxxxxxxxxxxxxxxx
> >
> > Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> > Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
> > Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
> > ---
> > kernel/trace/trace_uprobe.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > --- a/kernel/trace/trace_uprobe.c
> > +++ b/kernel/trace/trace_uprobe.c
> > @@ -552,8 +552,7 @@ error:
> > return ret;
> >
> > fail_address_parse:
> > - if (inode)
> > - iput(inode);
> > + iput(inode);
> >
> > pr_info("Failed to parse address or file.\n");
> >
> >
--
Ben Hutchings
I haven't lost my mind; it's backed up on tape somewhere.

Attachment: signature.asc
Description: This is a digitally signed message part