All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: David Milburn <dmilburn@redhat.com>
Cc: asamymuthupa@micron.com, linux-kernel@vger.kernel.org, thenzl@redhat.com
Subject: Re: [PATCH] mtip32xx: fix user_buffer check in exec_drive_command
Date: Wed, 12 Sep 2012 22:23:17 +0200	[thread overview]
Message-ID: <5050EF35.6090903@kernel.dk> (raw)
In-Reply-To: <1347476772-21798-1-git-send-email-dmilburn@redhat.com>

On 2012-09-12 21:06, David Milburn wrote:
> Current user_buffer check is incorrect and causes hdparm to fail
> 
> # hdparm -I /dev/rssda
>  HDIO_DRIVE_CMD(identify) failed: Input/output error
> 
> /dev/rssda:
> 
> Patching linux-3.6-rc5 hdparm works as expected
> 
> # hdparm -I /dev/rssda
> /dev/rssda:
> 
> ATA device, with non-removable media
> 	Model Number:       DELL_P320h-MTFDGAL350SAH                
> 	Serial Number:      00000000121302025F01
> 	Firmware Revision:  B1442808
> <snip>
> 
> Reported-by: Tomas Henzl <thenzl@redhat.com>
> Signed-off-by: David Milburn <dmilburn@redhat.com>
> ---
>  drivers/block/mtip32xx/mtip32xx.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
> index a8fddeb..b24efe3 100644
> --- a/drivers/block/mtip32xx/mtip32xx.c
> +++ b/drivers/block/mtip32xx/mtip32xx.c
> @@ -1900,7 +1900,7 @@ static int exec_drive_command(struct mtip_port *port, u8 *command,
>  	int rv = 0, xfer_sz = command[3];
>  
>  	if (xfer_sz) {
> -		if (user_buffer)
> +		if (!user_buffer)
>  			return -EFAULT;
>  
>  		buf = dmam_alloc_coherent(&port->dd->pdev->dev,

Thanks, that's clearly a bug. Applied.

-- 
Jens Axboe


      reply	other threads:[~2012-09-12 20:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 19:06 [PATCH] mtip32xx: fix user_buffer check in exec_drive_command David Milburn
2012-09-12 20:23 ` Jens Axboe [this message]

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=5050EF35.6090903@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asamymuthupa@micron.com \
    --cc=dmilburn@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thenzl@redhat.com \
    /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.