From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: Nguyen Viet Dung
<nv-dung-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>,
Laurent Pinchart
<laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/2] iommu/shmobile: Allocate archdata with kzalloc()
Date: Wed, 18 Dec 2013 14:14:30 +0000 [thread overview]
Message-ID: <2654806.jEV5NhJKD5@avalon> (raw)
In-Reply-To: <20131218011521.GI18992-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
On Wednesday 18 December 2013 10:15:21 Simon Horman wrote:
> On Tue, Dec 17, 2013 at 06:18:49PM +0100, Laurent Pinchart wrote:
> > The archdata attached_list field isn't initialized, leading to random
> > crashes when accessed. Use kzalloc() to allocate the whole structure and
> > make sure all fields get initialized properly.
> >
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
>
> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Thank you Simon.
Joerg, could you please pick those two patches up for v3.14 ?
> > ---
> >
> > drivers/iommu/shmobile-iommu.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/iommu/shmobile-iommu.c
> > b/drivers/iommu/shmobile-iommu.c index d572863..7a3b928 100644
> > --- a/drivers/iommu/shmobile-iommu.c
> > +++ b/drivers/iommu/shmobile-iommu.c
> > @@ -380,14 +380,13 @@ int ipmmu_iommu_init(struct shmobile_ipmmu *ipmmu)
> > kmem_cache_destroy(l1cache);
> > return -ENOMEM;
> > }
> > - archdata = kmalloc(sizeof(*archdata), GFP_KERNEL);
> > + archdata = kzalloc(sizeof(*archdata), GFP_KERNEL);
> > if (!archdata) {
> > kmem_cache_destroy(l1cache);
> > kmem_cache_destroy(l2cache);
> > return -ENOMEM;
> > }
> > spin_lock_init(&archdata->attach_lock);
> > - archdata->attached = NULL;
> > archdata->ipmmu = ipmmu;
> > ipmmu_archdata = archdata;
> > bus_set_iommu(&platform_bus_type, &shmobile_iommu_ops);
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-12-18 14:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-17 17:18 [PATCH 0/2] SH Mobile IOMMU fixes Laurent Pinchart
2013-12-17 17:18 ` [PATCH 2/2] iommu/shmobile: Turn the flush_lock mutex into a spinlock Laurent Pinchart
2013-12-18 1:16 ` Simon Horman
[not found] ` <1387300730-28783-1-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2013-12-17 17:18 ` [PATCH 1/2] iommu/shmobile: Allocate archdata with kzalloc() Laurent Pinchart
2013-12-18 1:15 ` Simon Horman
[not found] ` <20131218011521.GI18992-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2013-12-18 14:14 ` Laurent Pinchart [this message]
2014-01-07 14:36 ` [PATCH 0/2] SH Mobile IOMMU fixes Joerg Roedel
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=2654806.jEV5NhJKD5@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
--cc=laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
--cc=linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nv-dung-HEF513clHfp3+QwDJ9on6Q@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox