From: Tejun Heo <tj@kernel.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH block/for-next] blkcg: add missing NULL check in ioc_cpd_alloc()
Date: Fri, 30 Aug 2019 06:10:58 -0700 [thread overview]
Message-ID: <20190830131058.GY2263813@devbig004.ftw2.facebook.com> (raw)
ioc_cpd_alloc() forgot to check NULL return from kzalloc(). Add it.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: kbuild test robot <lkp@intel.com>
---
block/blk-iocost.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index 9c8046ac5925..2aae8ec391ef 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -1888,8 +1888,10 @@ static struct blkcg_policy_data *ioc_cpd_alloc(gfp_t gfp)
struct ioc_cgrp *iocc;
iocc = kzalloc(sizeof(struct ioc_cgrp), gfp);
- iocc->dfl_weight = CGROUP_WEIGHT_DFL;
+ if (!iocc)
+ return NULL;
+ iocc->dfl_weight = CGROUP_WEIGHT_DFL;
return &iocc->cpd;
}
next reply other threads:[~2019-08-30 13:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-30 13:10 Tejun Heo [this message]
2019-08-30 13:16 ` [PATCH block/for-next] blkcg: add missing NULL check in ioc_cpd_alloc() Jens Axboe
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=20190830131058.GY2263813@devbig004.ftw2.facebook.com \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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