[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cd5db43e-160e-448a-9708-3c5e44c0d34c@email.android.com>
Date: Sat, 21 Sep 2013 11:37:30 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Al Viro <viro@...IV.linux.org.uk>, Dave Jones <davej@...hat.com>,
Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: tracing: don't stuff stale pointers in filp->private_data
Or make the assignment in an else block.
-- Steve
Al Viro <viro@...IV.linux.org.uk> wrote:
>On Fri, Sep 20, 2013 at 12:47:32PM -0400, Dave Jones wrote:
>> Probably harmless, but still not a nice thing to do.
>>
>> Signed-off-by: Dave Jones <davej@...oraproject.org>
>>
>> diff --git a/kernel/trace/trace_events.c
>b/kernel/trace/trace_events.c
>> index 368a4d5..75d3556 100644
>> --- a/kernel/trace/trace_events.c
>> +++ b/kernel/trace/trace_events.c
>> @@ -1124,6 +1124,7 @@ static int system_tr_open(struct inode *inode,
>struct file *filp)
>> if (ret < 0) {
>> trace_array_put(tr);
>> kfree(dir);
>> + dir = NULL;
>> }
>>
>> filp->private_data = dir;
>
>Er... Why not simply return ret; instead?
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists