From: Jacob Pan <jacob.jun.pan@linux.intel.com>
To: Arjun Sreedharan <arjun024@gmail.com>
Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/thermal: fix calloc argument ordering
Date: Mon, 18 Aug 2014 11:18:12 -0700 [thread overview]
Message-ID: <20140818111812.0807809e@ultegra> (raw)
In-Reply-To: <1408354400-1656-1-git-send-email-arjun024@gmail.com>
On Mon, 18 Aug 2014 15:03:20 +0530
Arjun Sreedharan <arjun024@gmail.com> wrote:
> @number first, @size second argument
>
> Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
> ---
Acked-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Thanks for the fix.
> tools/thermal/tmon/sysfs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/thermal/tmon/sysfs.c b/tools/thermal/tmon/sysfs.c
> index dfe4548..1c12536 100644
> --- a/tools/thermal/tmon/sysfs.c
> +++ b/tools/thermal/tmon/sysfs.c
> @@ -446,7 +446,7 @@ int probe_thermal_sysfs(void)
> return -1;
> }
>
> - ptdata.tzi = calloc(sizeof(struct tz_info),
> ptdata.max_tz_instance+1);
> + ptdata.tzi = calloc(ptdata.max_tz_instance+1, sizeof(struct
> tz_info)); if (!ptdata.tzi) {
> fprintf(stderr, "Err: allocate tz_info\n");
> return -1;
> @@ -454,8 +454,8 @@ int probe_thermal_sysfs(void)
>
> /* we still show thermal zone information if there is no
> cdev */ if (ptdata.nr_cooling_dev) {
> - ptdata.cdi = calloc(sizeof(struct cdev_info),
> - ptdata.max_cdev_instance + 1);
> + ptdata.cdi = calloc(ptdata.max_cdev_instance + 1,
> + sizeof(struct cdev_info));
> if (!ptdata.cdi) {
> free(ptdata.tzi);
> fprintf(stderr, "Err: allocate cdev_info\n");
[Jacob Pan]
prev parent reply other threads:[~2014-08-18 18:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-18 9:33 [PATCH] tools/thermal: fix calloc argument ordering Arjun Sreedharan
2014-08-18 12:37 ` edubezval
2014-08-18 18:18 ` Jacob Pan [this message]
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=20140818111812.0807809e@ultegra \
--to=jacob.jun.pan@linux.intel.com \
--cc=arjun024@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rui.zhang@intel.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