linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] iommu/omap: fix NULL pointer dereference
Date: Wed, 22 Feb 2012 08:56:23 +0000	[thread overview]
Message-ID: <20120222085623.GF22675@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1329900772-9306-2-git-send-email-ohad@wizery.com>

On Wed, Feb 22, 2012 at 10:52:52AM +0200, Ohad Ben-Cohen wrote:
> @@ -274,7 +274,7 @@ static ssize_t debug_read_mem(struct file *file, char __user *userbuf,
>  	mutex_lock(&iommu_debug_lock);
>  
>  	area = omap_find_iovm_area(dev, (u32)ppos);
> -	if (IS_ERR(area)) {
> +	if (IS_ERR_OR_NULL(area)) {
>  		bytes = -EINVAL;

There's something else which needs fixing here - the return code.  If
omap_find_iovm_area() returns an error code that needs propagating.
Otherwise it might as well just return NULL for all errors.

  reply	other threads:[~2012-02-22  8:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-22  8:52 [PATCH 1/2] iommu/omap: fix erroneous omap-iommu-debug API calls Ohad Ben-Cohen
2012-02-22  8:52 ` [PATCH 2/2] iommu/omap: fix NULL pointer dereference Ohad Ben-Cohen
2012-02-22  8:56   ` Russell King - ARM Linux [this message]
2012-02-22  9:10     ` Ohad Ben-Cohen
2012-02-22  9:17       ` Russell King - ARM Linux

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=20120222085623.GF22675@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).