Re: [PATCH 07/12] qla2xxx: Prevent SysFS access when chip is down (fwd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It looks like an unlock is missing before line 1000.

Is it correct that the same test is done on lines 994 and 999?

julia

---------- Forwarded message ----------
Date: Wed, 13 Feb 2019 16:26:08 +0800
From: kbuild test robot <lkp@xxxxxxxxx>
To: kbuild@xxxxxx
Cc: Julia Lawall <julia.lawall@xxxxxxx>
Subject: Re: [PATCH 07/12] qla2xxx: Prevent SysFS access when chip is down

CC: kbuild-all@xxxxxx
In-Reply-To: <20190212234046.29809-8-hmadhani@xxxxxxxxxxx>
References: <20190212234046.29809-8-hmadhani@xxxxxxxxxxx>
TO: Himanshu Madhani <hmadhani@xxxxxxxxxxx>
CC: James.Bottomley@xxxxxxxxxxxxxxxxxxxxx, martin.petersen@xxxxxxxxxx
CC: hmadhani@xxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx

Hi Quinn,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on next-20190212]
[cannot apply to v5.0-rc4]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Himanshu-Madhani/qla2xxx-Misc-bug-fixes-for-the-driver/20190213-094944
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago

>> drivers/scsi/qla2xxx/qla_attr.c:1000:2-8: preceding lock on line 993

# https://github.com/0day-ci/linux/commit/58bb85be77c39429aa890a60b04fbddc4e172e81
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 58bb85be77c39429aa890a60b04fbddc4e172e81
vim +1000 drivers/scsi/qla2xxx/qla_attr.c

ce0423f4 Andrew Vasquez 2009-06-03   977
11bbc1d8 Andrew Vasquez 2009-06-03   978  static ssize_t
2c3c8bea Chris Wright   2010-05-12   979  qla2x00_sysfs_read_dcbx_tlv(struct file *filp, struct kobject *kobj,
11bbc1d8 Andrew Vasquez 2009-06-03   980  		       struct bin_attribute *bin_attr,
11bbc1d8 Andrew Vasquez 2009-06-03   981  		       char *buf, loff_t off, size_t count)
11bbc1d8 Andrew Vasquez 2009-06-03   982  {
11bbc1d8 Andrew Vasquez 2009-06-03   983  	struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
11bbc1d8 Andrew Vasquez 2009-06-03   984  	    struct device, kobj)));
11bbc1d8 Andrew Vasquez 2009-06-03   985  	struct qla_hw_data *ha = vha->hw;
11bbc1d8 Andrew Vasquez 2009-06-03   986  	int rval;
11bbc1d8 Andrew Vasquez 2009-06-03   987
11bbc1d8 Andrew Vasquez 2009-06-03   988  	if (!capable(CAP_SYS_ADMIN) || off != 0 || count > DCBX_TLV_DATA_SIZE)
11bbc1d8 Andrew Vasquez 2009-06-03   989  		return 0;
11bbc1d8 Andrew Vasquez 2009-06-03   990
11bbc1d8 Andrew Vasquez 2009-06-03   991  	if (ha->dcbx_tlv)
11bbc1d8 Andrew Vasquez 2009-06-03   992  		goto do_read;
b6faaaf7 Quinn Tran     2018-09-04  @993  	mutex_lock(&vha->hw->optrom_mutex);
b6faaaf7 Quinn Tran     2018-09-04   994  	if (qla2x00_chip_is_down(vha)) {
b6faaaf7 Quinn Tran     2018-09-04   995  		mutex_unlock(&vha->hw->optrom_mutex);
22ebde16 Quinn Tran     2018-08-02   996  		return 0;
b6faaaf7 Quinn Tran     2018-09-04   997  	}
22ebde16 Quinn Tran     2018-08-02   998
58bb85be Quinn Tran     2019-02-12   999  	if (qla2x00_chip_is_down(vha))
58bb85be Quinn Tran     2019-02-12 @1000  		return 0;
58bb85be Quinn Tran     2019-02-12  1001
11bbc1d8 Andrew Vasquez 2009-06-03  1002  	ha->dcbx_tlv = dma_alloc_coherent(&ha->pdev->dev, DCBX_TLV_DATA_SIZE,
11bbc1d8 Andrew Vasquez 2009-06-03  1003  	    &ha->dcbx_tlv_dma, GFP_KERNEL);
11bbc1d8 Andrew Vasquez 2009-06-03  1004  	if (!ha->dcbx_tlv) {
b6faaaf7 Quinn Tran     2018-09-04  1005  		mutex_unlock(&vha->hw->optrom_mutex);
7c3df132 Saurav Kashyap 2011-07-14  1006  		ql_log(ql_log_warn, vha, 0x7078,
11bbc1d8 Andrew Vasquez 2009-06-03  1007  		    "Unable to allocate memory for DCBX TLV read-data.\n");
b668ae37 Joe Carnuccio  2011-08-16  1008  		return -ENOMEM;
11bbc1d8 Andrew Vasquez 2009-06-03  1009  	}
11bbc1d8 Andrew Vasquez 2009-06-03  1010
11bbc1d8 Andrew Vasquez 2009-06-03  1011  do_read:
11bbc1d8 Andrew Vasquez 2009-06-03  1012  	memset(ha->dcbx_tlv, 0, DCBX_TLV_DATA_SIZE);
11bbc1d8 Andrew Vasquez 2009-06-03  1013
11bbc1d8 Andrew Vasquez 2009-06-03  1014  	rval = qla2x00_get_dcbx_params(vha, ha->dcbx_tlv_dma,
11bbc1d8 Andrew Vasquez 2009-06-03  1015  	    DCBX_TLV_DATA_SIZE);
b6faaaf7 Quinn Tran     2018-09-04  1016
b6faaaf7 Quinn Tran     2018-09-04  1017  	mutex_unlock(&vha->hw->optrom_mutex);
b6faaaf7 Quinn Tran     2018-09-04  1018
11bbc1d8 Andrew Vasquez 2009-06-03  1019  	if (rval != QLA_SUCCESS) {
7c3df132 Saurav Kashyap 2011-07-14  1020  		ql_log(ql_log_warn, vha, 0x7079,
7c3df132 Saurav Kashyap 2011-07-14  1021  		    "Unable to read DCBX TLV (%x).\n", rval);
b668ae37 Joe Carnuccio  2011-08-16  1022  		return -EIO;
11bbc1d8 Andrew Vasquez 2009-06-03  1023  	}
11bbc1d8 Andrew Vasquez 2009-06-03  1024
11bbc1d8 Andrew Vasquez 2009-06-03  1025  	memcpy(buf, ha->dcbx_tlv, count);
11bbc1d8 Andrew Vasquez 2009-06-03  1026
11bbc1d8 Andrew Vasquez 2009-06-03  1027  	return count;
11bbc1d8 Andrew Vasquez 2009-06-03  1028  }
11bbc1d8 Andrew Vasquez 2009-06-03  1029

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux