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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=c+664qQqiKOLmvdFScizUC7+88SrCx7WJnp0b@mail.gmail.com>
Date:	Thu, 24 Mar 2011 14:35:00 -0400
From:	Mike Frysinger <vapier@...too.org>
To:	Jamie Iles <jamie@...ieiles.com>
Cc:	linux-kernel@...r.kernel.org, gregkh@...e.de
Subject: Re: [RFC PATCHv2 3/4] drivers/otp: allow an ioctl to be specified

On Thu, Mar 24, 2011 at 11:21, Jamie Iles wrote:
> Some drivers may need an ioctl method to provide device specific control
> such as blackfin for providing locking.  Regions can specify an ioctl to
> be used but this field method is optional.

shouldnt this just be squashed into patch 1 since you havent merged
any of this yet ?

> +static long otp_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
> +{
> +       struct otp_region *region = filp->private_data;
> +       long ret = -ENOTTY;
> +
> +       if (down_interruptible(&otp_sem))
> +               return -ERESTARTSYS;
> +
> +       if (region->ops->ioctl)
> +               ret = region->ops->ioctl(region, cmd, arg);
> +
> +       up(&otp_sem);
> +
> +       return ret;
> +}

the existence check can be pulled out of the locking

long ret;

if (!region->ops->ioctl)
    return -ENOTTY;

if (down_interruptible(&otp_sem))

    return -ERESTARTSYS;

ret = region->ops->ioctl(region, cmd, arg);

up(&otp_sem);

return ret;
-mike
--
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