From: Tomas Henzl <thenzl@redhat.com>
To: Quentin Lambert <lambert.quentin@gmail.com>,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] scsi: pmcraid: Add missing resource releases
Date: Tue, 22 Nov 2016 17:14:46 +0100 [thread overview]
Message-ID: <4a93981a-4d1e-206c-5ac6-cae486163760@redhat.com> (raw)
In-Reply-To: <20161119174318.20394-1-lambert.quentin@gmail.com>
On 19.11.2016 18:43, Quentin Lambert wrote:
> Most error branches following the call to pmcraid_get_free_cmd contain
> a call to pmcraid_return_cmd. This patch add these calls where they are
> missing.
>
> Moreover, most error branches following the call to class_create contain
> a call to class_destroy. This patch add these calls where they are
> missing.
>
> This issue was found with Hector.
>
> Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Looks good,
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Tomas
>
> ---
> drivers/scsi/pmcraid.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> --- a/drivers/scsi/pmcraid.c
> +++ b/drivers/scsi/pmcraid.c
> @@ -3787,11 +3787,11 @@ static long pmcraid_ioctl_passthrough(
> direction);
> if (rc) {
> pmcraid_err("couldn't build passthrough ioadls\n");
> - goto out_free_buffer;
> + goto out_free_cmd;
> }
> } else if (request_size < 0) {
> rc = -EINVAL;
> - goto out_free_buffer;
> + goto out_free_cmd;
> }
>
> /* If data is being written into the device, copy the data from user
> @@ -3908,6 +3908,8 @@ out_handle_response:
>
> out_free_sglist:
> pmcraid_release_passthrough_ioadls(cmd, request_size, direction);
> +
> +out_free_cmd:
> pmcraid_return_cmd(cmd);
>
> out_free_buffer:
> @@ -6018,8 +6020,10 @@ static int __init pmcraid_init(void)
>
> error = pmcraid_netlink_init();
>
> - if (error)
> + if (error) {
> + class_destroy(pmcraid_class);
> goto out_unreg_chrdev;
> + }
>
> error = pci_register_driver(&pmcraid_driver);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" 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:[~2016-11-22 16:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-19 17:43 Quentin Lambert
2016-11-22 16:14 ` Tomas Henzl [this message]
2016-11-22 22:03 ` Martin K. Petersen
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=4a93981a-4d1e-206c-5ac6-cae486163760@redhat.com \
--to=thenzl@redhat.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lambert.quentin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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®