re: staging: sep: Basic infrastructure for SEP DMA access to non CPU regions

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

 



[ This is sort of old, but apparently I didn't send it Feb ].

Hello Mark A. Allyn,

This is a semi-automatic email about new static checker warnings.

The patch aca58ec828af: "staging: sep: Basic infrastructure for SEP
DMA access to non CPU regions" from Feb 10, 2012, leads to the
following Smatch complaint:

drivers/staging/sep/sep_main.c:2911 sep_free_dma_tables_and_dcb()
	 warn: variable dereferenced before check '*dma_ctx' (see line 2929)

drivers/staging/sep/sep_main.c
  2897          if (((*dma_ctx)->secure_dma == false) && (isapplet == true)) {
                      ^^^^^^^^
New dereference.

  2898                  dev_dbg(&sep->pdev->dev, "[PID%d] handling applet\n",
  2899                          current->pid);
  2900  
  2901                  /* Tail stuff is only for non secure_dma */
  2902                  /* Set pointer to first DCB table */
  2903                  dcb_table_ptr = (struct sep_dcblock *)
  2904                          (sep->shared_addr +
  2905                          SEP_DRIVER_SYSTEM_DCB_MEMORY_OFFSET_IN_BYTES);
  2906  
  2907                  /**
  2908                   * Go over each DCB and see if
  2909                   * tail pointer must be updated
  2910                   */
  2911			for (i = 0; dma_ctx && *dma_ctx &&
                                    ^^^^^^^
New check.

  2912				i < (*dma_ctx)->nr_dcb_creat; i++, dcb_table_ptr++) {
  2913				if (dcb_table_ptr->out_vr_tail_pt) {
  2914					pt_hold = (unsigned long)dcb_table_ptr->
  2915						out_vr_tail_pt;
  2916					tail_pt = (void *)pt_hold;
  2917					if (is_kva == true) {
  2918						error = -ENODEV;
  2919						break;
  2920					} else {
  2921						error_temp = copy_to_user(
  2922							(void __user *)tail_pt,
  2923							dcb_table_ptr->tail_data,
  2924							dcb_table_ptr->tail_data_size);
  2925					}
  2926					if (error_temp) {
  2927						/* Release the DMA resource */
  2928						error = -EFAULT;
  2929						break;
  2930					}
  2931				}

regards,
dan carpenter

Ps:

@linux.intel.com addresses have been broken for 6 months now and today
it seems like @intel.com addresses are broken too.  Have you guys
considered signing up for Google Apps for Business?  I've used them
before and their email service is pretty reliable and easy to use.  It's
basically like gmail.

Really email is very complicated.  It's often cheaper to just outsource
it to Google instead of trying to hire admins and configure everything
yourself.

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux