From: Szymon Janc <szymon.janc@tieto.com>
To: Anupam Roy <anupam.r@samsung.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] android/client/if-hl.c:Handle failure from malloc() request
Date: Tue, 21 Jul 2015 06:22:01 -0700 (PDT) [thread overview]
Message-ID: <1920962.6CvK0I8IiL@leonov> (raw)
In-Reply-To: <1437483677-9793-1-git-send-email-anupam.r@samsung.com>
Hi Anupam,
On Tuesday 21 of July 2015 09:01:17 Anupam Roy wrote:
> Ping
I looks like I never got the original patch. Could you resend it?
(seems like you hit timeframe when my gmail was experiencing issues with vger
server and I had to resubscribe to mailing list)
> > -----Original Message-----
> >
> >From: Anupam Roy <anupam.r@samsung.com>
> >To: linux-bluetooth@vger.kernel.org
> >Cc:sachin.dev@samsung.com; anupam.r@samsung.com
> >Date : Jun 23, 2015 21:04 (GMT+09:00)
> >Title : [PATCH] android/client/if-hl.c:Handle failure from malloc() request
> >
> >
> >In case malloc() request fails, just print error message
> >and return. Dereferencing reg.mdep_cfg in case of failure
> >can lead to crash.
> >---
> >
> > android/client/if-hl.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> >diff --git a/android/client/if-hl.c b/android/client/if-hl.c
> >index e0818ba..bd05671 100644
> >--- a/android/client/if-hl.c
> >+++ b/android/client/if-hl.c
> >@@ -201,6 +201,10 @@ static void register_application_p(int argc, const
> >char **argv)>
> > reg.number_of_mdeps = atoi(argv[6]);
> >
> > reg.mdep_cfg = malloc(reg.number_of_mdeps * sizeof(bthl_mdep_cfg_t));
> >
> >+ if (!reg.mdep_cfg) {
> >+ haltest_error("malloc failed\n");
> >+ return;
> >+ }
> >
> > mdep_argc_init = 7;
> >
> > for (i = 0; i < reg.number_of_mdeps; i++) {
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
> in the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
BR
Szymon Janc
next prev parent reply other threads:[~2015-07-21 13:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 13:01 [PATCH] android/client/if-hl.c:Handle failure from malloc() request Anupam Roy
2015-07-21 13:22 ` Szymon Janc [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-07-21 13:38 Anupam Roy
2015-07-27 19:22 ` Szymon Janc
2015-06-23 12:04 Anupam Roy
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=1920962.6CvK0I8IiL@leonov \
--to=szymon.janc@tieto.com \
--cc=anupam.r@samsung.com \
--cc=linux-bluetooth@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