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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/