From: Jan Kasprzak <kas@fi.muni.cz>
To: Wang Hai <wanghai38@huawei.com>
Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] cosa: Add missing kfree in error path of cosa_write
Date: Tue, 10 Nov 2020 17:38:09 +0100 [thread overview]
Message-ID: <20201110163809.GE26676@fi.muni.cz> (raw)
In-Reply-To: <20201110144614.43194-1-wanghai38@huawei.com>
Wang Hai wrote:
: If memory allocation for 'kbuf' succeed, cosa_write() doesn't have a
: corresponding kfree() in exception handling. Thus add kfree() for this
: function implementation.
Acked-By: Jan "Yenya" Kasprzak <kas@fi.muni.cz>
Looks correct, thanks.
That said, COSA is an ancient ISA bus device designed in late 1990s,
I doubt anybody is still using it. I still do have one or two of these
cards myself, but no computer with ISA bus to use them.
-Yenya
:
: Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
: Reported-by: Hulk Robot <hulkci@huawei.com>
: Signed-off-by: Wang Hai <wanghai38@huawei.com>
: ---
: drivers/net/wan/cosa.c | 1 +
: 1 file changed, 1 insertion(+)
:
: diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
: index f8aed0696d77..2369ca250cd6 100644
: --- a/drivers/net/wan/cosa.c
: +++ b/drivers/net/wan/cosa.c
: @@ -889,6 +889,7 @@ static ssize_t cosa_write(struct file *file,
: chan->tx_status = 1;
: spin_unlock_irqrestore(&cosa->lock, flags);
: up(&chan->wsem);
: + kfree(kbuf);
: return -ERESTARTSYS;
: }
: }
: --
: 2.17.1
--
| Jan "Yenya" Kasprzak <kas at {fi.muni.cz - work | yenya.net - private}> |
| http://www.fi.muni.cz/~kas/ GPG: 4096R/A45477D5 |
We all agree on the necessity of compromise. We just can't agree on
when it's necessary to compromise. --Larry Wall
next prev parent reply other threads:[~2020-11-10 16:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 14:46 Wang Hai
2020-11-10 16:38 ` Jan Kasprzak [this message]
2020-11-12 2:03 ` Jakub Kicinski
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=20201110163809.GE26676@fi.muni.cz \
--to=kas@fi.muni.cz \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wanghai38@huawei.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®