From: "Philip J. Kelleher" <pjk1939@linux.vnet.ibm.com>
To: axboe@kernel.dk
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] rsxx: Correcting return values during failure scenarios.
Date: Tue, 6 Aug 2013 16:11:52 -0500 [thread overview]
Message-ID: <20130806211152.GD4939@oc6784271780.ibm.com> (raw)
From: Philip J Kelleher <pjk1939@linux.vnet.ibm.com>
The rsxx driver is returning the wrong values during
copy_from_user and copy_to_user. It, also, is not
setting ENOMEM during a failed workqueue allocation.
Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com>
-------------------------------------------------------------------------------
diff -uprN -X linux-block-vanilla/Documentation/dontdiff linux-block-vanilla/drivers/block/rsxx/core.c linux-block/drivers/block/rsxx/core.c
--- linux-block-vanilla/drivers/block/rsxx/core.c 2013-07-23 10:43:46.182724965 -0500
+++ linux-block/drivers/block/rsxx/core.c 2013-07-23 10:46:25.646465285 -0500
@@ -199,9 +199,8 @@ static ssize_t rsxx_cram_read(struct fil
if (st)
return st;
- st = copy_to_user(ubuf, buf, cnt);
- if (st)
- return st;
+ if (copy_to_user(ubuf, buf, cnt))
+ return -EFAULT;
info->offset += cnt;
@@ -222,9 +221,8 @@ static ssize_t rsxx_cram_write(struct fi
if (!buf)
return -ENOMEM;
- st = copy_from_user(buf, ubuf, cnt);
- if (st)
- return st;
+ if (copy_from_user(buf, ubuf, cnt))
+ return -EFAULT;
info->f_pos = (u32)*ppos + info->offset;
@@ -946,6 +944,7 @@ static int rsxx_pci_probe(struct pci_dev
card->event_wq = create_singlethread_workqueue(DRIVER_NAME"_event");
if (!card->event_wq) {
dev_err(CARD_TO_DEV(card), "Failed card event setup.\n");
+ st = -ENOMEM;
goto failed_event_handler;
}
next reply other threads:[~2013-08-06 21:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-06 21:11 Philip J. Kelleher [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-07-23 20:19 Philip J. Kelleher
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=20130806211152.GD4939@oc6784271780.ibm.com \
--to=pjk1939@linux.vnet.ibm.com \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®