All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leonard Crestez <leonard.crestez@nxp.com>
To: "sboyd@codeaurora.org" <sboyd@codeaurora.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mturquette@baylibre.com" <mturquette@baylibre.com>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>
Subject: Re: [PATCH] clk: core: Copy connection id
Date: Sat, 25 Feb 2017 09:20:02 +0000	[thread overview]
Message-ID: <1488014402.6461.3.camel@nxp.com> (raw)
In-Reply-To: <20170224204439.GD25384@codeaurora.org>

T24gRnJpLCAyMDE3LTAyLTI0IGF0IDEyOjQ0IC0wODAwLCBTdGVwaGVuIEJveWQgd3JvdGU6DQo+
IE9uIDAyLzIwLCBMZW9uYXJkIENyZXN0ZXogd3JvdGU6DQo+ID4gU29tZSBkcml2ZXJzIHVzZSBz
cHJpbnRmIHRvIGJ1aWxkIGNsayBjb25uZWN0aW9uIGlkIG5hbWVzIGJ1dCB0aGUNCj4gPiBjbGsN
Cj4gPiBjb3JlIHdpbGwgc2F2ZSB0aG9zZSBzdHJpbmdzIGFuZCBvY2Nhc2lvbmFsbHkgcHJpbnQg
dGhlbSBiYWNrLg0KPiA+IER1cGxpY2F0ZQ0KPiA+IHRoZSBjb25faWQgc3RyaW5ncyBpbnN0ZWFk
IG9mIGZpeGluZyBhbGwgdGhlIHVzZXJzLg0KPiANCj4gR29vZCBjYXRjaC4gV2hhdCBhYm91dCBk
ZXZfaWQgdGhvdWdoPyBUaGF0IGNvdWxkIGFsc28gaGF2ZSB0aGUNCj4gc2FtZSBwcm9ibGVtIGlm
IHNvbWUgZGV2aWNlIGlzIHJlbW92ZWQgYW5kIHdlJ3JlIHN0aWxsIGhvbGRpbmcgYQ0KPiByZWZl
cmVuY2UgdG8gdGhlIGtvYmplY3QncyBuYW1lLiBUaGlzIGlzIHByb2JhYmx5IG1vcmUgcmFyZSB0
aGFuDQo+IHdoYXQgaXMgaGFwcGVuaW5nIGhlcmUsIGJ1dCBzdGlsbCBzZWVtcyBwb3NzaWJsZSB0
aGF0IHdlIG1pZ2h0DQo+IHRyaXAgb3ZlciB0aGF0IGxhdGVyLg0KDQpBIGRldmljZSBzaG91bGQg
bm9ybWFsbHkgZnJlZSB0aGUgY2xrcyBpdCB1c2VzIGJlZm9yZSBpdCBpcyBkZXN0cm95ZWQuDQpU
aGlzIG1lYW5zIHRoYXQgaWYgZGV2X2lkIGlzIHBvaW50aW5nIHRvIGZyZWVkIG1lbW9yeSB0aGVu
IHRoZSBjbGsNCml0c2VsZiB3YXMgcHJvYmFibHkgbGVha2VkLCByaWdodD8NCg0KVGhpcyBpcyBv
YnZpb3VzIG1pc3VzZSBvZiB0aGUgQVBJLCBub3QgbGlrZSBzcHJpbnRmLWluZyBhIGNvbl9pZCBp
biBhDQpjb21wbGV4IGRyaXZlci4gSSBkb24ndCByZWFsbHkgdGhpbmsgaXQncyB3b3J0aCBjb3B5
aW5nIHN0cmluZ3MgZm9yIGl0Lg0KDQotLQ0KUmVnYXJkcywNCkxlb25hcmQ=

WARNING: multiple messages have this Message-ID (diff)
From: Leonard Crestez <leonard.crestez@nxp.com>
To: "sboyd@codeaurora.org" <sboyd@codeaurora.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mturquette@baylibre.com" <mturquette@baylibre.com>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>
Subject: Re: [PATCH] clk: core: Copy connection id
Date: Sat, 25 Feb 2017 09:20:02 +0000	[thread overview]
Message-ID: <1488014402.6461.3.camel@nxp.com> (raw)
In-Reply-To: <20170224204439.GD25384@codeaurora.org>

On Fri, 2017-02-24 at 12:44 -0800, Stephen Boyd wrote:
> On 02/20, Leonard Crestez wrote:
> > Some drivers use sprintf to build clk connection id names but the
> > clk
> > core will save those strings and occasionally print them back.
> > Duplicate
> > the con_id strings instead of fixing all the users.
> 
> Good catch. What about dev_id though? That could also have the
> same problem if some device is removed and we're still holding a
> reference to the kobject's name. This is probably more rare than
> what is happening here, but still seems possible that we might
> trip over that later.

A device should normally free the clks it uses before it is destroyed.
This means that if dev_id is pointing to freed memory then the clk
itself was probably leaked, right?

This is obvious misuse of the API, not like sprintf-ing a con_id in a
complex driver. I don't really think it's worth copying strings for it.

--
Regards,
Leonard

  reply	other threads:[~2017-02-25  9:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 13:20 [PATCH] clk: core: Copy connection id Leonard Crestez
2017-02-24 20:44 ` Stephen Boyd
2017-02-25  9:20   ` Leonard Crestez [this message]
2017-02-25  9:20     ` Leonard Crestez
2017-02-28  8:05     ` sboyd
2017-03-02 12:45       ` Leonard Crestez
2017-03-02 12:45         ` Leonard Crestez
2017-03-07 13:53         ` sboyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1488014402.6461.3.camel@nxp.com \
    --to=leonard.crestez@nxp.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.