Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753503AbbELPgv (ORCPT ); Tue, 12 May 2015 11:36:51 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:50036 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751583AbbELPgt (ORCPT ); Tue, 12 May 2015 11:36:49 -0400 From: Arnd Bergmann To: y2038@lists.linaro.org Cc: Baolin Wang , tglx@linutronix.de, linux-kernel@vger.kernel.org Subject: Re: [Y2038] [PATCH v3 08/23] posix-timers:Convert to the 64bit methods for the timer_settime syscall function Date: Tue, 12 May 2015 17:36:38 +0200 Message-ID: <2196679.VURrorBePj@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1431439814-28820-1-git-send-email-baolin.wang@linaro.org> References: <1431439814-28820-1-git-send-email-baolin.wang@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:YBQXy80yGZlHcOwQZANv7M9XE6ALs6d5z+95vkJ7AWsjuXgbfOB 1wzMMMM/JWovbNJR73jUcmdbQpcsK5B73v7qNEbLlZA428M43gJ3JNQb1lb2lParGY/y4Bz MsoqtUulDrmpfCYlNwt9yZSOcka3ca96bEUm6VGBw85YhUNaDJyCI33cbI3KH5S9vyWYsKH 9yu9MbkzLoWf506Tlb9CA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1192 Lines: 29 On Tuesday 12 May 2015 22:10:14 Baolin Wang wrote: > +static int default_timer_set64(struct k_itimer *timr, int flags, > + struct itimerspec64 *new_setting64, > + struct itimerspec64 *old_setting64) > +{ > + struct k_clock *kc = clockid_to_kclock(timr->it_clock); > + struct itimerspec new_setting, old_setting; > + int ret; > + > + new_setting = itimerspec64_to_itimerspec(new_setting64); > + old_setting = itimerspec64_to_itimerspec(old_setting64); > + ret = kc->timer_set(timr, flags, &new_setting, &old_setting); > + if (!ret && old_setting64) > + *old_setting64 = itimerspec_to_itimerspec64(&old_setting); > + > + return ret; > +} > You check old_setting64 for a NULL pointer in the second access, but not in the first one, which is a bug. Please also check whether the variable is used as input, output or both. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/