All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux dev-4.7 v2] drivers/fsi: Don't scan after fsi-gpio_master unbound
@ 2017-03-02 21:15 Christopher Bostic
  2017-03-03  7:49 ` Joel Stanley
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher Bostic @ 2017-03-02 21:15 UTC (permalink / raw
  To: joel; +Cc: Christopher Bostic, openbmc

Check pointers prior to scanning master in the sysfs scan
file.  These get invalidated after an unbind operation.

Signed-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
---
v2:
    Return error if invalid pointers passed in.
---
 drivers/fsi/fsi-master-gpio.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c
index c5f4f9c..49f3399 100644
--- a/drivers/fsi/fsi-master-gpio.c
+++ b/drivers/fsi/fsi-master-gpio.c
@@ -476,7 +476,14 @@ static ssize_t store_scan(struct device *dev,
 				const char *buf,
 				size_t count)
 {
-	struct fsi_master_gpio *master = dev_get_drvdata(dev);
+	struct fsi_master_gpio *master;
+
+	if (!dev)
+		return -EINVAL;
+
+	master = dev_get_drvdata(dev);
+	if (!master)
+		return -EINVAL;
 
 	fsi_master_gpio_init(master);
 
-- 
1.8.2.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH linux dev-4.7 v2] drivers/fsi: Don't scan after fsi-gpio_master unbound
  2017-03-02 21:15 [PATCH linux dev-4.7 v2] drivers/fsi: Don't scan after fsi-gpio_master unbound Christopher Bostic
@ 2017-03-03  7:49 ` Joel Stanley
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Stanley @ 2017-03-03  7:49 UTC (permalink / raw
  To: Christopher Bostic; +Cc: OpenBMC Maillist

On Fri, Mar 3, 2017 at 7:45 AM, Christopher Bostic
<cbostic@linux.vnet.ibm.com> wrote:
> Check pointers prior to scanning master in the sysfs scan
> file.  These get invalidated after an unbind operation.
>
> Signed-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
> ---
> v2:
>     Return error if invalid pointers passed in.

Thanks, I think this is better.

Applied to dev-4.7.

Cheers,

Joel

> ---
>  drivers/fsi/fsi-master-gpio.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c
> index c5f4f9c..49f3399 100644
> --- a/drivers/fsi/fsi-master-gpio.c
> +++ b/drivers/fsi/fsi-master-gpio.c
> @@ -476,7 +476,14 @@ static ssize_t store_scan(struct device *dev,
>                                 const char *buf,
>                                 size_t count)
>  {
> -       struct fsi_master_gpio *master = dev_get_drvdata(dev);
> +       struct fsi_master_gpio *master;
> +
> +       if (!dev)
> +               return -EINVAL;
> +
> +       master = dev_get_drvdata(dev);
> +       if (!master)
> +               return -EINVAL;
>
>         fsi_master_gpio_init(master);
>
> --
> 1.8.2.2
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-03  7:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-02 21:15 [PATCH linux dev-4.7 v2] drivers/fsi: Don't scan after fsi-gpio_master unbound Christopher Bostic
2017-03-03  7:49 ` Joel Stanley

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.