From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-gpio@vger.kernel.org,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] gpiolib-acpi: Duplicate con_id string when adding it to the crs lookup list
Date: Thu, 14 Apr 2016 15:41:11 +0300 [thread overview]
Message-ID: <20160414124111.GO4329@intel.com> (raw)
In-Reply-To: <20160414122749.GV1714@lahna.fi.intel.com>
On Thu, Apr 14, 2016 at 03:27:49PM +0300, Mika Westerberg wrote:
> On Wed, Apr 13, 2016 at 07:10:36PM +0300, ville.syrjala@linux.intel.com wrote:
> > diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> > index 682070d20f00..6238ddb81709 100644
> > --- a/drivers/gpio/gpiolib-acpi.c
> > +++ b/drivers/gpio/gpiolib-acpi.c
> > @@ -950,7 +950,7 @@ int acpi_gpio_count(struct device *dev, const char *con_id)
> > struct acpi_crs_lookup {
> > struct list_head node;
> > struct acpi_device *adev;
> > - const char *con_id;
> > + char *con_id;
>
> Why it cannot be left as const?
I suppose it could.
>
> > };
> >
> > static DEFINE_MUTEX(acpi_crs_lookup_lock);
> > @@ -977,7 +977,7 @@ bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id)
> > lookup = kmalloc(sizeof(*lookup), GFP_KERNEL);
> > if (lookup) {
> > lookup->adev = adev;
> > - lookup->con_id = con_id;
> > + lookup->con_id = kstrdup(con_id, GFP_KERNEL);
> > list_add_tail(&lookup->node, &acpi_crs_lookup_list);
> > }
> > }
> > --
> > 2.7.4
--
Ville Syrjälä
Intel OTC
WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-gpio@vger.kernel.org,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] gpiolib-acpi: Duplicate con_id string when adding it to the crs lookup list
Date: Thu, 14 Apr 2016 15:41:11 +0300 [thread overview]
Message-ID: <20160414124111.GO4329@intel.com> (raw)
In-Reply-To: <20160414122749.GV1714@lahna.fi.intel.com>
On Thu, Apr 14, 2016 at 03:27:49PM +0300, Mika Westerberg wrote:
> On Wed, Apr 13, 2016 at 07:10:36PM +0300, ville.syrjala@linux.intel.com wrote:
> > diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> > index 682070d20f00..6238ddb81709 100644
> > --- a/drivers/gpio/gpiolib-acpi.c
> > +++ b/drivers/gpio/gpiolib-acpi.c
> > @@ -950,7 +950,7 @@ int acpi_gpio_count(struct device *dev, const char *con_id)
> > struct acpi_crs_lookup {
> > struct list_head node;
> > struct acpi_device *adev;
> > - const char *con_id;
> > + char *con_id;
>
> Why it cannot be left as const?
I suppose it could.
>
> > };
> >
> > static DEFINE_MUTEX(acpi_crs_lookup_lock);
> > @@ -977,7 +977,7 @@ bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id)
> > lookup = kmalloc(sizeof(*lookup), GFP_KERNEL);
> > if (lookup) {
> > lookup->adev = adev;
> > - lookup->con_id = con_id;
> > + lookup->con_id = kstrdup(con_id, GFP_KERNEL);
> > list_add_tail(&lookup->node, &acpi_crs_lookup_list);
> > }
> > }
> > --
> > 2.7.4
--
Ville Syrj�l�
Intel OTC
next prev parent reply other threads:[~2016-04-14 12:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-13 16:10 [PATCH] gpiolib-acpi: Duplicate con_id string when adding it to the crs lookup list ville.syrjala
2016-04-14 12:27 ` Mika Westerberg
2016-04-14 12:41 ` Ville Syrjälä [this message]
2016-04-14 12:41 ` Ville Syrjälä
2016-04-25 13:01 ` [PATCH v2] " ville.syrjala
2016-04-25 13:21 ` Mika Westerberg
2016-04-25 13:21 ` Mika Westerberg
2016-04-25 21:18 ` Dmitry Torokhov
2016-04-25 21:18 ` Dmitry Torokhov
2016-04-28 5:04 ` Alexandre Courbot
2016-04-28 5:04 ` Alexandre Courbot
2016-04-28 10:33 ` Ville Syrjälä
2016-04-28 10:33 ` Ville Syrjälä
2016-04-28 11:55 ` Alexandre Courbot
2016-04-28 12:30 ` Ville Syrjälä
2016-04-28 12:30 ` Ville Syrjälä
2016-04-28 16:54 ` Dmitry Torokhov
2016-04-28 16:54 ` Dmitry Torokhov
2016-04-28 16:56 ` Dmitry Torokhov
2016-04-28 16:56 ` Dmitry Torokhov
2016-04-30 11:51 ` Linus Walleij
2016-04-30 11:51 ` Linus Walleij
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=20160414124111.GO4329@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dmitry.torokhov@gmail.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=stable@vger.kernel.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.