Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1489128
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.4 061/118] dm log writes: fix check of kthread_run() return value |
| Date | Thu, 22 Sep 2016 19:40:02 +0200 |
| Message-ID | <skg8y-Rq-37@gated-at.bofh.it> (permalink) |
| References | <skg8x-Rq-3@gated-at.bofh.it> |
| X-Original-To | linux-kernel@vger.kernel.org |
| X-Mailer | git-send-email 2.10.0 |
| User-Agent | quilt/0.64 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 34 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Vladimir Zapolskiy <vz@mleia.com>, Mike Snitzer <snitzer@redhat.com> |
| X-Original-Date | Thu, 22 Sep 2016 19:29:21 +0200 |
| X-Original-Message-ID | <20160922172941.818082622@linuxfoundation.org> |
| X-Original-References | <20160922172938.643879685@linuxfoundation.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1489128 |
Show key headers only | View raw
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Zapolskiy <vz@mleia.com>
commit 91e630d9ae6de6f740ef7c8176736eb55366833e upstream.
The kthread_run() function returns either a valid task_struct or
ERR_PTR() value, check for NULL is invalid. This change fixes potential
for oops, e.g. in OOM situation.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-log-writes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/md/dm-log-writes.c
+++ b/drivers/md/dm-log-writes.c
@@ -456,9 +456,9 @@ static int log_writes_ctr(struct dm_targ
goto bad;
}
- ret = -EINVAL;
lc->log_kthread = kthread_run(log_writes_kthread, lc, "log-write");
- if (!lc->log_kthread) {
+ if (IS_ERR(lc->log_kthread)) {
+ ret = PTR_ERR(lc->log_kthread);
ti->error = "Couldn't alloc kthread";
dm_put_device(ti, lc->dev);
dm_put_device(ti, lc->logdev);
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 4.4 061/118] dm log writes: fix check of kthread_run() return value Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-22 19:40 +0200
csiph-web