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] [day] [month] [year] [list]
Date:   Tue, 30 May 2017 23:10:17 +0000
From:   <Woojung.Huh@...rochip.com>
To:     <andrew@...n.ch>
CC:     <f.fainelli@...il.com>, <netdev@...r.kernel.org>,
        <davem@...emloft.net>, <UNGLinuxDriver@...rochip.com>
Subject: RE: [PATCH v4 net-next 3/5] dsa: add DSA switch driver for
 Microchip KSZ9477

Hi Andrew,
> > +static int ksz_port_mdb_del(struct dsa_switch *ds, int port,
> > +			    const struct switchdev_obj_port_mdb *mdb)
> > +{
> > +	struct ksz_device *dev = ds->priv;
> > +	u32 static_table[4];
> > +	u32 data;
> > +	int index;
> > +	int ret = 0;
> > +	u32 mac_hi, mac_lo;
> > +
> > +	mac_hi = ((mdb->addr[0] << 8) | mdb->addr[1]);
> > +	mac_lo = ((mdb->addr[2] << 24) | (mdb->addr[3] << 16));
> > +	mac_lo |= ((mdb->addr[4] << 8) | mdb->addr[5]);
> > +
> > +	mutex_lock(&dev->alu_mutex);
> > +
> > +	for (index = 0; index < dev->num_statics; index++) {
> > +		/* find empty slot first */
> > +		data = (index << ALU_STAT_INDEX_S) |
> > +			ALU_STAT_READ | ALU_STAT_START;
> > +		ksz_write32(dev, REG_SW_ALU_STAT_CTRL__4, data);
> > +
> > +		/* wait to be finished */
> > +		ret = wait_alu_sta_ready(dev, ALU_STAT_START, 1000);
> > +		if (ret < 0) {
> > +			dev_dbg(dev->dev, "Failed to read ALU STATIC\n");
> > +			goto exit;
> > +		}
> > +
> > +		/* read ALU static table */
> > +		read_table(ds, static_table);
> > +
> > +		mutex_unlock(&dev->alu_mutex);
> 
> Is this mutex unlock here correct? It looks like we will unlock it
> again when we eventually get to exit: below.
> 
Thanks for catching this. Will submit new patch soon.

- Woojung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ