Re: [REGRESSION][PATCH] mqueue: Ignore the validity of abs_timeoutparameter when message can be performed immediately

From: Thomas Gleixner
Date: Wed Mar 14 2012 - 19:03:04 EST


B1;2601;0cOn Wed, 14 Mar 2012, Andrew Morton wrote:
> On Fri, 02 Mar 2012 16:42:35 +0900
> Akira Takeuchi <takeuchi.akr@xxxxxxxxxxxxxxxx> wrote:
> > @@ -996,6 +1015,10 @@ SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr,
> > if (filp->f_flags & O_NONBLOCK) {
> > spin_unlock(&info->lock);
> > ret = -EAGAIN;
> > + } else if (unlikely(timeout_param_error)) {
> > + spin_unlock(&info->lock);
> > + ret = timeout_param_error;
> > + msg_ptr = NULL; /* just for shutting up warning */

Huch? We are not "just" shutting up some warning because the compiler
is yelling at us. No, either we initialize the variable upfront to
NULL or we skip the whole return path by going to fput directly.

Duh, that code is convoluted enough already.

Thanks,

tglx

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/