From: "Rangankar, Manish" <Manish.Rangankar@cavium.com>
To: Colin King <colin.king@canonical.com>,
Dept-Eng QLogic Storage Upstream
<QLogic-Storage-Upstream@cavium.com>,
"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] scsi: qedi: return via va_end to match corresponding va_start
Date: Thu, 22 Dec 2016 08:51:13 +0000 [thread overview]
Message-ID: <D4818FAC.360C4%manish.rangankar@cavium.com> (raw)
In-Reply-To: <20161216141043.22324-1-colin.king@canonical.com>
On 16/12/16 7:40 PM, "Colin King" <colin.king@canonical.com> wrote:
>From: Colin Ian King <colin.king@canonical.com>
>
>Although on most systems va_end is a no-op, it is good practice
>to use va_end on the function return path, especially since the
>va_start documenation states:
>
> "Each invocation of va_start() must be matched by a corresponding
> invocation of va_end() in the same function."
>
>Found with static analysis by CoverityScan, CIDs 1389477-1389479
>
>Signed-off-by: Colin Ian King <colin.king@canonical.com>
>---
> drivers/scsi/qedi/qedi_dbg.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/scsi/qedi/qedi_dbg.c b/drivers/scsi/qedi/qedi_dbg.c
>index 2bdedb9..8fd28b0 100644
>--- a/drivers/scsi/qedi/qedi_dbg.c
>+++ b/drivers/scsi/qedi/qedi_dbg.c
>@@ -52,7 +52,7 @@ qedi_dbg_warn(struct qedi_dbg_ctx *qedi, const char
>*func, u32 line,
> vaf.va = &va;
>
> if (!(qedi_dbg_log & QEDI_LOG_WARN))
>- return;
>+ goto ret;
>
> if (likely(qedi) && likely(qedi->pdev))
> pr_warn("[%s]:[%s:%d]:%d: %pV", dev_name(&qedi->pdev->dev),
>@@ -60,6 +60,7 @@ qedi_dbg_warn(struct qedi_dbg_ctx *qedi, const char
>*func, u32 line,
> else
> pr_warn("[0000:00:00.0]:[%s:%d]: %pV", nfunc, line, &vaf);
>
>+ret:
> va_end(va);
> }
>
>@@ -80,7 +81,7 @@ qedi_dbg_notice(struct qedi_dbg_ctx *qedi, const char
>*func, u32 line,
> vaf.va = &va;
>
> if (!(qedi_dbg_log & QEDI_LOG_NOTICE))
>- return;
>+ goto ret;
>
> if (likely(qedi) && likely(qedi->pdev))
> pr_notice("[%s]:[%s:%d]:%d: %pV",
>@@ -89,6 +90,7 @@ qedi_dbg_notice(struct qedi_dbg_ctx *qedi, const char
>*func, u32 line,
> else
> pr_notice("[0000:00:00.0]:[%s:%d]: %pV", nfunc, line, &vaf);
>
>+ret:
> va_end(va);
> }
>
>@@ -109,7 +111,7 @@ qedi_dbg_info(struct qedi_dbg_ctx *qedi, const char
>*func, u32 line,
> vaf.va = &va;
>
> if (!(qedi_dbg_log & level))
>- return;
>+ goto ret;
>
> if (likely(qedi) && likely(qedi->pdev))
> pr_info("[%s]:[%s:%d]:%d: %pV", dev_name(&qedi->pdev->dev),
>@@ -117,6 +119,7 @@ qedi_dbg_info(struct qedi_dbg_ctx *qedi, const char
>*func, u32 line,
> else
> pr_info("[0000:00:00.0]:[%s:%d]: %pV", nfunc, line, &vaf);
>
>+ret:
> va_end(va);
> }
>
>--
>2.10.2
Acked-by: Manish Rangankar <manish.rangankar@cavium.com>
next prev parent reply other threads:[~2016-12-22 16:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-16 14:10 Colin King
2016-12-22 8:51 ` Rangankar, Manish [this message]
2017-01-05 5:32 ` 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=D4818FAC.360C4%manish.rangankar@cavium.com \
--to=manish.rangankar@cavium.com \
--cc=QLogic-Storage-Upstream@cavium.com \
--cc=colin.king@canonical.com \
--cc=jejb@linux.vnet.ibm.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
Powered by JetHome