mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vincenzo Frascino <vincenzo.frascino@arm.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Andy Lutomirski" <luto@kernel.org>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Anna-Maria Behnsen" <anna-maria@linutronix.de>,
	"Nam Cao" <namcao@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vdso/gettimeofday: Clean up read of tz_minuteswest and tz_dsttime
Date: Wed, 2 Sep 2026 14:56:02 +0100	[thread overview]
Message-ID: <384cd3b7-f379-4cf0-bdb3-50c071749ab2@arm.com> (raw)
In-Reply-To: <20260902-vdso-tz-v1-1-4d37a6b85ff9@linutronix.de>



On 02/09/2026 13:06, Thomas Weißschuh wrote:
> When these fields got moved from 'struct vdso_time_data' to the new
> 'struct vdso_clock', this access was forgotten.
> 
> 'vd' is not an array, but a pointer to a single structure. The code
> works by accident in its current form as CS_HRES_COARSE is 0.
> 
> Replace the incorrect array access with a regular pointer dereference.
> 
> Fixes: 886653e36639 ("vdso: Rework struct vdso_time_data and introduce struct vdso_clock")
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>

> ---
>  lib/vdso/gettimeofday.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
> index f7a591aba59f..6e9b03051bee 100644
> --- a/lib/vdso/gettimeofday.c
> +++ b/lib/vdso/gettimeofday.c
> @@ -374,8 +374,8 @@ __cvdso_gettimeofday_data(const struct vdso_time_data *vd,
>  		if (vdso_is_timens_clock(vc))
>  			vd = vdso_timens_data(vd);
>  
> -		tz->tz_minuteswest = vd[CS_HRES_COARSE].tz_minuteswest;
> -		tz->tz_dsttime = vd[CS_HRES_COARSE].tz_dsttime;
> +		tz->tz_minuteswest = vd->tz_minuteswest;
> +		tz->tz_dsttime = vd->tz_dsttime;
>  	}
>  
>  	return 0;
> 
> ---
> base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
> change-id: 20260902-vdso-tz-b999f43c24bb
> 
> Best regards,
> --  
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> 

-- 
Regards,
Vincenzo


      parent reply	other threads:[~2026-09-02 13:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 12:06 Thomas Weißschuh
2026-09-02 13:13 ` Nam Cao
2026-09-02 13:56 ` Vincenzo Frascino [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=384cd3b7-f379-4cf0-bdb3-50c071749ab2@arm.com \
    --to=vincenzo.frascino@arm.com \
    --cc=anna-maria@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=namcao@linutronix.de \
    --cc=tglx@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    /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

all inboxes | Powered by JetHome®