From: Julia Lawall <julia.lawall@lip6.fr>
To: Joshua Morris <josh.h.morris@us.ibm.com>
Cc: Jeff Moyer <jmoyer@redhat.com>,
kernel-janitors@vger.kernel.org,
Philip Kelleher <pjk1939@linux.vnet.ibm.com>,
dan.carpenter@oracle.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: add abort on failure
Date: Fri, 8 Aug 2014 11:30:48 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.10.1408081129150.2348@hadrien> (raw)
In-Reply-To: <1407486050-9375-1-git-send-email-Julia.Lawall@lip6.fr>
On Fri, 8 Aug 2014, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Initializing card seems to be critical to the rest of the probe process, so
> abort the probe function if the calls to rsxx_load_config and
> rsxx_get_num_targets do not succeed.
Note that this is not tested. Nevertheless, at least the first failure
will leave card in an unknown partially initialized state, which seems
undesirable.
julia
> Suggested by Jeff Moyer.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> drivers/block/rsxx/core.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c
> index a8de2ee..ae2805b 100644
> --- a/drivers/block/rsxx/core.c
> +++ b/drivers/block/rsxx/core.c
> @@ -915,15 +915,19 @@ static int rsxx_pci_probe(struct pci_dev *dev,
>
> /************* Load Card Config *************/
> st = rsxx_load_config(card);
> - if (st)
> + if (st) {
> dev_err(CARD_TO_DEV(card),
> "Failed loading card config\n");
> + goto failed_dma_setup;
> + }
>
> /************* Setup DMA Engine *************/
> st = rsxx_get_num_targets(card, &card->n_targets);
> - if (st)
> + if (st) {
> dev_info(CARD_TO_DEV(card),
> "Failed reading the number of DMA targets\n");
> + goto failed_dma_setup;
> + }
>
> card->ctrl = kzalloc(card->n_targets * sizeof(*card->ctrl), GFP_KERNEL);
> if (!card->ctrl) {
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2014-08-08 9:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-08 8:20 Julia Lawall
2014-08-08 9:30 ` Julia Lawall [this message]
[not found] ` <OF8E178B75.111E73DE-ON86257D2E.00561BEC-86257D2E.00590C0D@us.ibm.com>
2014-08-08 16:22 ` Julia Lawall
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=alpine.DEB.2.10.1408081129150.2348@hadrien \
--to=julia.lawall@lip6.fr \
--cc=dan.carpenter@oracle.com \
--cc=jmoyer@redhat.com \
--cc=josh.h.morris@us.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pjk1939@linux.vnet.ibm.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 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®