public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <yujie.liu@intel.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	<linux-scsi@vger.kernel.org>, <target-devel@vger.kernel.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: <llvm@lists.linux.dev>, <kbuild-all@lists.01.org>,
	John Youn <John.Youn@synopsys.com>,
	Felipe Balbi <balbi@kernel.org>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg KH <greg@kroah.com>, <linux-usb@vger.kernel.org>
Subject: Re: [PATCH 01/36] target: Handle MI_REPORT_SUPPORTED_OPERATION_CODES
Date: Tue, 12 Jul 2022 10:48:38 +0800	[thread overview]
Message-ID: <d61ef707-d40c-ee1c-2767-9c5bf974ea0d@intel.com> (raw)
In-Reply-To: <202207120920.oEIle78M-lkp@intel.com>

Hi Thinh,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on 90557fa89d3e99286506593fd5180f699c41b152]

url:    https://github.com/intel-lab-lkp/linux/commits/Thinh-Nguyen/usb-gadget-f_tcm-Enhance-UASP-driver/20220707-074014
base:   90557fa89d3e99286506593fd5180f699c41b152
config: s390-randconfig-c005-20220710 (https://download.01.org/0day-ci/archive/20220712/202207120920.oEIle78M-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 6ce63e267aab79ca87bf63453d34dd3909ab978d)
reproduce (this is a W=1 build):
         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
         chmod +x ~/bin/make.cross
         # install s390 cross compiling tool for clang build
         # apt-get install binutils-s390x-linux-gnu
         # https://github.com/intel-lab-lkp/linux/commit/9a7c7d74b2c2d3c8524342cb0278ab8b77714bad
         git remote add linux-review https://github.com/intel-lab-lkp/linux
         git fetch --no-tags linux-review Thinh-Nguyen/usb-gadget-f_tcm-Enhance-UASP-driver/20220707-074014
         git checkout 9a7c7d74b2c2d3c8524342cb0278ab8b77714bad
         # save the config file
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 clang-analyzer

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <yujie.liu@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)

 >> drivers/target/target_core_alua.c:323:9: warning: Array access (from variable 'buf') results in an undefined pointer dereference [clang-analyzer-core.NullDereference]
            buf[1] = supported;
            ~~~    ^
    drivers/target/target_core_alua.c:271:2: note: 'buf' declared without an initial value
            unsigned char *buf;
            ^~~~~~~~~~~~~~~~~~
    drivers/target/target_core_alua.c:274:6: note: Assuming the condition is true
            if (cdb[2] != 1) {
                ^

vim +/buf +323 drivers/target/target_core_alua.c

c66ac9db8d4ad9 Nicholas Bellinger 2010-12-17  261
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  262  /*
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  263   * REPORT_SUPPORTED_OPERATION_CODES
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  264   *
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  265   * See spc4r17 section 6.27
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  266   */
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  267  sense_reason_t
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  268  target_emulate_report_supported_opcodes(struct se_cmd *cmd)
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  269  {
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  270  	unsigned char *cdb = cmd->t_task_cdb;
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  271  	unsigned char *buf;
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  272  	u8 supported = 0;
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  273
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  274  	if (cdb[2] != 1) {
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  275  		pr_warn("Invalid command format %d\n", cdb[2]);
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  276  		goto out;
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  277  	}
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  278
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  279  	buf = transport_kmap_data_sg(cmd);
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  280  	if (!buf)
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  281  		return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  282
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  283  	switch (cdb[3]) {
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  284  	case INQUIRY:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  285  	case MODE_SENSE:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  286  	case MODE_SENSE_10:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  287  	case READ_CAPACITY:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  288  	case SERVICE_ACTION_IN_16:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  289  	case REPORT_LUNS:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  290  	case REQUEST_SENSE:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  291  	case SYNCHRONIZE_CACHE:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  292  	case REZERO_UNIT:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  293  	case SEEK_6:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  294  	case SEEK_10:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  295  	case TEST_UNIT_READY:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  296  	case SEND_DIAGNOSTIC:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  297  	case MAINTENANCE_IN:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  298  	case READ_6:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  299  	case READ_10:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  300  	case READ_16:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  301  	case WRITE_6:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  302  	case WRITE_10:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  303  	case WRITE_16:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  304  	case VERIFY_16:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  305  	case MODE_SELECT:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  306  	case MODE_SELECT_10:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  307  	case START_STOP:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  308  	case SECURITY_PROTOCOL_IN:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  309  	case SECURITY_PROTOCOL_OUT:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  310  		supported = 3;
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  311  		break;
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  312  	case ATA_12:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  313  	case ATA_16:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  314  	case VERIFY:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  315  	case ZBC_IN:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  316  	case ZBC_OUT:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  317  	default:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  318  		break;
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  319  	}
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  320
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  321  	transport_kunmap_data_sg(cmd);
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  322  out:
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06 @323  	buf[1] = supported;
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  324  	target_complete_cmd(cmd, SAM_STAT_GOOD);
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  325  	return 0;
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  326  }
9a7c7d74b2c2d3 Thinh Nguyen       2022-07-06  327

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

       reply	other threads:[~2022-07-12  2:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <202207120920.oEIle78M-lkp@intel.com>
2022-07-12  2:48 ` kernel test robot [this message]
2022-07-06 23:34 [PATCH 00/36] usb: gadget: f_tcm: Enhance UASP driver Thinh Nguyen
2022-07-06 23:34 ` [PATCH 01/36] target: Handle MI_REPORT_SUPPORTED_OPERATION_CODES Thinh Nguyen
2022-07-07  8:01   ` Oliver Neukum
2022-07-07 11:44   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d61ef707-d40c-ee1c-2767-9c5bf974ea0d@intel.com \
    --to=yujie.liu@intel.com \
    --cc=John.Youn@synopsys.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=greg@kroah.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=martin.petersen@oracle.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox