All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "eric miao" <eric.y.miao@gmail.com>
Cc: linux-kernel@vger.kernel.org, szabolcs.gyurko@tlt.hu,
	Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Subject: Re: [PATCH] make ds1wm driver to check ds1wm_platform_data pointer against NULL
Date: Fri, 9 Nov 2007 17:02:38 -0800	[thread overview]
Message-ID: <20071109170238.628fdf0d.akpm@linux-foundation.org> (raw)
In-Reply-To: <f17812d70711082207p455c5bc9v25fea9a0585ba152@mail.gmail.com>

On Fri, 9 Nov 2007 14:07:31 +0800
"eric miao" <eric.y.miao@gmail.com> wrote:

> Do a sanity check for the "struct ds1wm_platform_data" pointer passed in
> by the platform_device, and so to enforce each platform to provide a
> valid structure.
> 
> Signed-off-by: eric miao <eric.miao@marvell.com>
> ---
>  drivers/w1/masters/ds1wm.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
> index 5747997..11ce9ec 100644
> --- a/drivers/w1/masters/ds1wm.c
> +++ b/drivers/w1/masters/ds1wm.c
> @@ -351,6 +351,10 @@ static int ds1wm_probe(struct platform_device *pdev)
>  		goto err0;
>  	}
>  	plat = pdev->dev.platform_data;
> +	if (!plat) {
> +		ret = -ENXIO;
> +		goto err0;
> +	}
>  	ds1wm_data->bus_shift = plat->bus_shift;
>  	ds1wm_data->pdev = pdev;
>  	ds1wm_data->pdata = plat;

I don't understand this change.  Could you please provide some more details
regarding what problem it is solving?  How can pdev->dev.platform_data==NULL
come about?

Thanks.

  reply	other threads:[~2007-11-10  1:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-09  6:07 [PATCH] make ds1wm driver to check ds1wm_platform_data pointer against NULL eric miao
2007-11-10  1:02 ` Andrew Morton [this message]
2007-11-10 17:08   ` Evgeniy Polyakov
2007-11-11  2:26     ` eric miao

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=20071109170238.628fdf0d.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=eric.y.miao@gmail.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=szabolcs.gyurko@tlt.hu \
    /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.