lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 13 Dec 2006 18:51:47 +0530
From:	"Tushar Adeshara" <adesharatushar@...il.com>
To:	"Evgeniy Polyakov" <johnpol@....mipt.ru>,
	linux-kernel@...r.kernel.org
Subject: Re: Kevent POSIX timers support.

On 11/23/06, Evgeniy Polyakov <johnpol@....mipt.ru> wrote:
> On Wed, Nov 22, 2006 at 01:44:16PM +0300, Evgeniy Polyakov (johnpol@....mipt.ru) wrote:
> +static int posix_kevent_init_timer(struct k_itimer *tmr, int fd)
> +{
> +       struct ukevent uk;
> +       struct file *file;
> +       struct kevent_user *u;
> +       int err;
> +
> +       file = fget(fd);
> +       if (!file) {
> +               err = -EBADF;
> +               goto err_out;
> +       }
> +
> +       if (file->f_op != &kevent_user_fops) {
> +               err = -EINVAL;
> +               goto err_out_fput;
> +       }
> +
> +       u = file->private_data;
> +
> +       memset(&uk, 0, sizeof(struct ukevent));
> +
> +       uk.type = KEVENT_POSIX_TIMER;
> +       uk.id.raw_u64 = (unsigned long)(tmr); /* Just cast to something unique */
> +       uk.ptr = tmr;
> +
> +       tmr->it_sigev_value.sival_ptr = file;
> +
> +       err = kevent_user_add_ukevent(&uk, u);

I think these four lines are not required. Irrespective of return
value of kevent_user_add_ukevent(), we are going to release file, and
return err.

> +       if (err)
> +               goto err_out_fput;
> +
> +       fput(file);
> +
> +       return 0;


> +
> +err_out_fput:
> +       fput(file);
> +err_out:
> +       return err;
> +}
> +

-- 
Regards,
Tushar
--------------------
It's not a problem, it's an opportunity for improvement. Lets improve.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ