* [PATCH] ceph: Check memory allocation result
@ 2018-01-26 6:54 Chengguang Xu
2018-01-29 16:42 ` Ilya Dryomov
0 siblings, 1 reply; 4+ messages in thread
From: Chengguang Xu @ 2018-01-26 6:54 UTC (permalink / raw)
To: ceph-devel; +Cc: zyan, sage, davem, idryomov, netdev, Chengguang Xu
Should check result of kstrndup() in case of memory allocation failure.
Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
---
net/ceph/ceph_common.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 5c036d2..1e492ef 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -421,6 +421,10 @@ struct ceph_options *
opt->name = kstrndup(argstr[0].from,
argstr[0].to-argstr[0].from,
GFP_KERNEL);
+ if (!opt->name) {
+ err = -ENOMEM;
+ goto out;
+ }
break;
case Opt_secret:
opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ceph: Check memory allocation result
2018-01-26 6:54 [PATCH] ceph: Check memory allocation result Chengguang Xu
@ 2018-01-29 16:42 ` Ilya Dryomov
2018-01-30 0:08 ` Chengguang Xu
0 siblings, 1 reply; 4+ messages in thread
From: Ilya Dryomov @ 2018-01-29 16:42 UTC (permalink / raw)
To: Chengguang Xu
Cc: Ceph Development, Yan, Zheng, Sage Weil, David S. Miller, netdev
On Fri, Jan 26, 2018 at 7:54 AM, Chengguang Xu <cgxu519@icloud.com> wrote:
> Should check result of kstrndup() in case of memory allocation failure.
>
> Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
> ---
> net/ceph/ceph_common.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
> index 5c036d2..1e492ef 100644
> --- a/net/ceph/ceph_common.c
> +++ b/net/ceph/ceph_common.c
> @@ -421,6 +421,10 @@ struct ceph_options *
> opt->name = kstrndup(argstr[0].from,
> argstr[0].to-argstr[0].from,
> GFP_KERNEL);
> + if (!opt->name) {
> + err = -ENOMEM;
> + goto out;
> + }
> break;
> case Opt_secret:
> opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL);
Applied.
Thanks,
Ilya
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ceph: Check memory allocation result
2018-01-29 16:42 ` Ilya Dryomov
@ 2018-01-30 0:08 ` Chengguang Xu
2018-01-30 13:31 ` Ilya Dryomov
0 siblings, 1 reply; 4+ messages in thread
From: Chengguang Xu @ 2018-01-30 0:08 UTC (permalink / raw)
To: Ilya Dryomov; +Cc: Ceph Development, Yan, Zheng, Sage Weil
Hi Ilya
Is there a specific tree for ceph kernel client?
I found below git repository is quite old.
https://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git/
Thanks,
Chengguang.
> 在 2018年1月30日,上午12:42,Ilya Dryomov <idryomov@gmail.com> 写道:
>
> On Fri, Jan 26, 2018 at 7:54 AM, Chengguang Xu <cgxu519@icloud.com> wrote:
>> Should check result of kstrndup() in case of memory allocation failure.
>>
>> Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
>> ---
>> net/ceph/ceph_common.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
>> index 5c036d2..1e492ef 100644
>> --- a/net/ceph/ceph_common.c
>> +++ b/net/ceph/ceph_common.c
>> @@ -421,6 +421,10 @@ struct ceph_options *
>> opt->name = kstrndup(argstr[0].from,
>> argstr[0].to-argstr[0].from,
>> GFP_KERNEL);
>> + if (!opt->name) {
>> + err = -ENOMEM;
>> + goto out;
>> + }
>> break;
>> case Opt_secret:
>> opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL);
>
> Applied.
>
> Thanks,
>
> Ilya
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ceph: Check memory allocation result
2018-01-30 0:08 ` Chengguang Xu
@ 2018-01-30 13:31 ` Ilya Dryomov
0 siblings, 0 replies; 4+ messages in thread
From: Ilya Dryomov @ 2018-01-30 13:31 UTC (permalink / raw)
To: Chengguang Xu; +Cc: Ceph Development, Yan, Zheng, Sage Weil
On Tue, Jan 30, 2018 at 1:08 AM, Chengguang Xu <cgxu519@icloud.com> wrote:
> Hi Ilya
>
> Is there a specific tree for ceph kernel client?
>
> I found below git repository is quite old.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git/
Yes, as noted in MAINTAINERS:
git://github.com/ceph/ceph-client.git
Thanks,
Ilya
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-30 13:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-26 6:54 [PATCH] ceph: Check memory allocation result Chengguang Xu
2018-01-29 16:42 ` Ilya Dryomov
2018-01-30 0:08 ` Chengguang Xu
2018-01-30 13:31 ` Ilya Dryomov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.