[patch] vhost/scsi: potential memory corruption

2015-02-04 Thread Dan Carpenter
VHOST_SCSI_MAX_TARGET (256) elements so anything higher than 255 then it is invalid. I have made that the limit now. In vhost_scsi_send_evt() we mask away values higher than 255, but now that the limit has changed, we don't need the mask. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- Compile tested

Re: [PATCH 2/4] SCSI-QLA4...: Less function calls in qla4xxx_is_session_exists() after error detection

2015-02-07 Thread Dan Carpenter
*tmp_tddb; + struct ql4_tuple_ddb *fw_tddb = vzalloc(sizeof(*fw_tddb)); Don't do allocations in the initializers. Same for patches 3 and 4 as well. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord

Re: [PATCH 2/4] SCSI-QLA4...: Less function calls in qla4xxx_is_session_exists() after error detection

2015-02-07 Thread Dan Carpenter
On Sat, Feb 07, 2015 at 11:11:03AM +0100, Julia Lawall wrote: On Sat, 7 Feb 2015, Dan Carpenter wrote: On Fri, Feb 06, 2015 at 11:15:13PM +0100, SF Markus Elfring wrote: diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 2a00fd3..a7ca479 100644

[patch] be2iscsi: return correct error code in beiscsi_init_port()

2015-01-19 Thread Dan Carpenter
If hba_setup_cid_tbls() fails then this code should return an error code but instead the current code returns zero (success). Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index f319340..fe59ae6 100644

[patch] sd: fix an error return in probe()

2015-01-19 Thread Dan Carpenter
If device_add() fails then it should return the error code but instead the current code returns success. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index ebf35cb6..75a0b55 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c

[patch] [SCSI] mvumi: return a correct error code

2015-01-19 Thread Dan Carpenter
If kthread_create() fails then this should return an error code but the current code returns zero instead. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c index 3e6b866..586f72b 100644 --- a/drivers/scsi/mvumi.c +++ b/drivers/scsi

re: [SCSI] pmcraid: PMC-Sierra MaxRAID driver to support 6Gb/s SAS RAID controller

2015-01-06 Thread Dan Carpenter
= pmcraid_abort_cmd(cmd); ^^ This will Oops because cmd-scsi_cmd is NULL. 3861 spin_unlock_irqrestore(pinstance-host-host_lock, lock_flags); 3862 3863 if (cancel_cmd) { regards, dan carpenter

[patch] scsi: silence an overflow warning

2015-03-18 Thread Dan Carpenter
to happen in padding and thus the overflow is not harmful. But it costs us nothing to fix this and it silences a static checker warning. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index 251598e..a5d7464 100644 --- a/drivers/scsi

re: [SCSI] ipr: Increase max concurrent oustanding commands

2015-02-23 Thread Dan Carpenter
push the Smatch change later this week. It requires the cross function database to trigger this warning. 9039 return -ENOMEM; 9040 } regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord

[patch] lpfc: missing curly brace in lpfc_online()

2015-02-25 Thread Dan Carpenter
This is harmless because we do the same thing either way but, from the indenting, then it seems like lpfc_destroy_vport_work_array() was meant to be inside the if statement. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- The static checker complains about some of the other indents

[patch] tcm_fc: missing curly braces in ft_invl_hw_context()

2015-02-25 Thread Dan Carpenter
From the indenting, it looks like curly braces were intended here. Fixes: dcd998ccdbf7 ('tcm_fc: Handle DDP/SW fc_frame_payload_get failures in ft_recv_write_data') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c

[patch] [SCSI] bfa: fix bfa_cb_sfp_state_query()

2015-02-25 Thread Dan Carpenter
There are several missing curly braces so this function doesn't work as intended. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index 315d6d6..59c3492 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++ b/drivers/scsi/bfa

[patch] megaraid_sas: harmless memory corruption in megasas_mgmt_fw_ioctl()

2015-02-25 Thread Dan Carpenter
to use kbuff_arr[] again so we don't need to set it to NULL. I have deleted that line of code. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 890637f..834bfc0 100644 --- a/drivers/scsi

Re: [SCSI] csiostor: Chelsio FCoE offload driver

2015-02-26 Thread Dan Carpenter
can't be NULL so we should probably just delete the check. Anyway, I was looking at old csiostor bugs in my in box and this one from last November is more serious. On Wed, Apr 16, 2014 at 06:37:16PM +0300, Dan Carpenter wrote: Naresh's email is dead. regards, dan carpenter On Wed, Apr 16, 2014

[patch] [SCSI] mvumi: shift wrapping bug in mvumi_delete_internal_cmd()

2015-01-30 Thread Dan Carpenter
m_sg-baseaddr_h is a u32. We shift it 32 bits before casting it to dma_addr_t so the cast is too late. Fixes: f0c568a478f0 ('[SCSI] mvumi: Add Marvell UMI driver') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c index 3e6b866

re: aha1542: rework locking

2015-04-21 Thread Dan Carpenter
].dataptr, isa_page_to_bus(sg_page(sg)) 459 + sg-offset); 460 any2scsi(cptr[i].datalen, sg-length); 461 }; regards, dan carpenter -- To unsubscribe from this list: send the line

Re: aha1542: rework locking

2015-04-21 Thread Dan Carpenter
have to get very unlucky for this to deadlock. Should I just change that to GFP_ATOMIC? The other option is to do the allocation before taking the lock. That looks do-able. You are the expert here by virtue of you touched to code last. So you get to decide. :) regards, dan carpenter

Re: [PATCH 1/1] scsi: storvsc: Set the SRB flags correctly when no data transfer is needed

2015-04-25 Thread Dan Carpenter
On Fri, Apr 24, 2015 at 04:33:55PM -0700, K. Y. Srinivasan wrote: Set the SRB flags correctly when there is no data transfer. What are the user visible effects of this bug? We transfer bogus data? regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi

re: [SCSI] lpfc 8.2.7 : Rework the worker thread

2015-05-15 Thread Dan Carpenter
. 9370 */ regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [patch] sd: fix an error return in probe()

2015-04-14 Thread Dan Carpenter
I almost accidentally sent this one again. I still think it's correct. regards, dan carpenter On Mon, Jan 19, 2015 at 05:41:12PM +0300, Dan Carpenter wrote: If device_add() fails then it should return the error code but instead the current code returns success. Signed-off-by: Dan Carpenter

[patch] csiostor: fix an error code in csio_hw_init()

2015-04-14 Thread Dan Carpenter
We should return -ENOMEM if kzalloc() fails here instead of returning success. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c index 2e66f34..622bdab 100644 --- a/drivers/scsi/csiostor/csio_hw.c +++ b/drivers

Re: ufs: add ioctl interface for query request

2015-04-13 Thread Dan Carpenter
are not printed. But just remove them. They make the code uglier. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 01/14] parport: return value of attach and parport_register_driver

2015-04-08 Thread Dan Carpenter
On Wed, Apr 08, 2015 at 02:38:32PM +0300, Dan Carpenter wrote: 1) We can't apply this patch on its own so this way of breaking up the patches doesn't work. The right thing is to do add an attach_ret(). static int do_attach(drv) { if (drv-attach_ret) return drv

Re: [PATCH 01/14] parport: return value of attach and parport_register_driver

2015-04-08 Thread Dan Carpenter
also see your point. Hm... Minor comment: No need to preserve the error code if there are lots which we miss. We may as well hard code an error code. But that's a minor thing. Does this actually simplify the driver code? That's the more important thing. regards, dan carpenter

Re: [PATCH 01/14] parport: return value of attach and parport_register_driver

2015-04-08 Thread Dan Carpenter
On Wed, Apr 08, 2015 at 05:20:10PM +0530, Sudip Mukherjee wrote: On Wed, Apr 08, 2015 at 02:38:32PM +0300, Dan Carpenter wrote: 1) We can't apply this patch on its own so this way of breaking up the patches doesn't work. yes, if the first patch is reverted for any reason all the others need

re: ufs: add ioctl interface for query request

2015-04-09 Thread Dan Carpenter
: 4383 kfree(ioctl_data); 4384 kfree(desc); 4385 out: 4386 return err; 4387 } regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http

[patch] hpsa: fix an sprintf() overflow in the reset handler

2015-06-04 Thread Dan Carpenter
The string cmd %d RESET FAILED, new lockup detected is not quite large enough so the sprintf() will overflow. I have increased the size of the buffer and also changed the sprintf calls to snprintf. Fixes: 73153fe533bc ('hpsa: use block layer tag for command allocation') Signed-off-by: Dan

Re: [PATCH] SCSI-wd33c93: Deletion of a check before the function call wd33c93_setup

2015-06-25 Thread Dan Carpenter
be aware that Markus auto generates his patches and he doesn't even do a cursory review. I find it acceptable that some of my update suggestions do not fit to your quality expectations at the moment. -- Markus Elfring (https://lkml.org/lkml/2015/1/22/446) regards, dan carpenter -- To unsubscribe

Re: [patch] hpsa: fix an sprintf() overflow in the reset handler

2015-06-24 Thread Dan Carpenter
think. But either way, we both agree that 48 is probably safe. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: hpsa static checker issues

2015-06-19 Thread Dan Carpenter
to post these three patches linux-scsi. Is that correct? Yes. That's right. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

re: lpfc: Add support for ELS LCB.

2015-06-10 Thread Dan Carpenter
(beacon-lcb_type != LPFC_LCB_AMBER)) { Also: drivers/scsi/lpfc/lpfc_els.c:5261 lpfc_els_rcv_lcb() warn: possible memory leak of 'lcb_context' regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord

re: lpfc: Add support for RDP ELS command.

2015-06-10 Thread Dan Carpenter
, FAILURE); 2311 } regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

re: lpfc: Fix rport leak.

2015-06-10 Thread Dan Carpenter
rdata-pnode = NULL; Unchecked dereference. 3906 /* drop reference for earlier registeration */ 3907 put_device(rport-dev); regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe

Re: [PATCH 3/6] hv:scsi:Untangle the storage protocol negotiation from the vmbus protocol negotiation.

2015-06-01 Thread Dan Carpenter
you take a look at the other goto cleanup; places in this function and maybe add a comment, change it to something more clear like return 0; or fix the error code? regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord

Re: [PATCH 1/6] scsi: storvsc: Rather than look for sets of specific protocol versions, make decisions based on ranges.

2015-06-01 Thread Dan Carpenter
On Fri, May 29, 2015 at 01:29:14PM -0700, K. Y. Srinivasan wrote: From: keith.ma...@microsoft.com keith.ma...@microsoft.com Keith's name is wrong. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org

[patch] mptfusion: prevent some memory corruption

2015-07-03 Thread Dan Carpenter
integer overflows. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- During my QC process, I realized that I sent a similar patch last year, but never received a response. http://permalink.gmane.org/gmane.linux.kernel.janitors/32590 Looking at both of them, I guess I prefer today's patch

[patch] cxlflash: shift wrapping bug in afu_link_reset()

2015-08-18 Thread Dan Carpenter
port_sel is a u64 so the shifting should also be a 64 bit shift. Fixes: c21e0bbfc485 ('cxlflash: Base support for IBM CXL Flash Adapter') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index 0720d2f..f97421d 100644

[patch] scsi: aic94xx: set an error code on failure

2015-08-18 Thread Dan Carpenter
We recently did some cleanup here and now the static checkers notice that there is a missing error code when ioremap() fails. Let's set it to -ENOMEM. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c

[patch] qla4xxx: remove some bogus casts

2015-08-17 Thread Dan Carpenter
These casts are wrong and unnecessary. They annoy static checkers because they imply we are planning to write sizeof(long) bytes to a sizeof(u32) buffer which would corrupt memory. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi

Re: [patch] qla4xxx: remove some bogus casts

2015-08-18 Thread Dan Carpenter
On Mon, Aug 17, 2015 at 09:45:45PM -0700, Bart Van Assche wrote: On 08/17/2015 07:36 AM, Dan Carpenter wrote: These casts are wrong and unnecessary. They annoy static checkers because they imply we are planning to write sizeof(long) bytes to a sizeof(u32) buffer which would corrupt memory

Re: [patch] mptfusion: prevent some memory corruption

2015-08-21 Thread Dan Carpenter
Ping? regards, dan carpenter On Fri, Jul 03, 2015 at 11:53:03AM +0300, Dan Carpenter wrote: These are signed values the come from the user, we put a cap on the upper bounds but not on the lower bounds. We use karg.dataSgeOffset to calculate sz. We verify sz and proceed as if that means

[patch] [SCSI] atp870u: 64 bit bug in probe()

2015-07-29 Thread Dan Carpenter
On 64 bit CPUs there is a memory corruption bug on probe(). It should be a u32 pointer instead of an unsigned long pointer or we write past the end of the setupdata[] array. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- Someone reported in 2003 that probe has a NULL deref so maybe

Re: [PATCH 1/1] Drivers: hv: vmbus: fix init_vp_index() for reloading hv_netvsc

2015-08-13 Thread Dan Carpenter
object on that id. It's in Greg's char-misc-next tree. I like to have the commit id so I can look at buggy patches. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http

[patch] cxlflash: off by one bug in cxlflash_show_port_status()

2015-08-14 Thread Dan Carpenter
The should be = or we read one element past the end of the array. Fixes: c21e0bbfc485 ('cxlflash: Base support for IBM CXL Flash Adapter') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com Fixes: c21e0bbfc485 ('cxlflash: Base support for IBM CXL Flash Adapter') diff --git a/drivers/scsi

Re: [PATCH] aic7xxx: replace kmalloc/strcpy by kstrdup

2015-07-14 Thread Dan Carpenter
); } Remove the curly braces. And below as well. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[patch] mptfusion: don't allow negative bytes in kbuf_alloc_2_sgl()

2015-11-10 Thread Dan Carpenter
just check for it and return NULL. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c index fc73937..02b5f69 100644 --- a/drivers/message/fusion/mptctl.c +++ b/drivers/message/fusion/mptctl.c @@ -1038,6 +1038,10 @@ kbuf_alloc

[patch] hpsa: logical vs bitwise AND typo

2015-11-12 Thread Dan Carpenter
gned-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 6a8f958..a386036 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -8671,7 +8671,7 @@ static void hpsa_disable_rld_caching(struct ctlr_info *h) if ((rc != 0) |

[patch 2/2] megaraid_sas: missing curly braces in megasas_detach_one()

2015-11-07 Thread Dan Carpenter
The indenting indicates that there are supposed to be some curly braces here. Presumably it means we free something unintentionally leading to a use after free. Fixes: 3761cb4cf65e ('megaraid_sas: JBOD sequence number support') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.

[patch 1/2] megaraid_sas: remove a stray tab

2015-11-07 Thread Dan Carpenter
One line was indented more than the others. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index cc95372..829e9e9 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/driver

Re: [patch] ses: tighten range checks in ses_intf_add()

2015-11-05 Thread Dan Carpenter
James, could you take a look at this? My patch was really incomplete and even the bits that I wrote were buggy... :/ This might be easier for someone who is familiar with the code and can say what the expected ranges are etc. regards, dan carpenter -- To unsubscribe from this list: send

[patch] bfa: integer overflow bug in debugfs

2015-10-19 Thread Dan Carpenter
The "len << 2" operation can have an integer overflow and leading to a kernel crash. This is debugfs and thus root only so no one really cares, but we should fix it anyway just to make the static checker happy. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> dif

[patch 1/2] ses: tighten range checking in ses_enclosure_data_process()

2015-10-19 Thread Dan Carpenter
r instead of the end of the buffer (desc_ptr + 4). Let's tighten that up as well. Reported-by: "Berry Cheng 程君(成淼)" <chengmiao...@alibaba-inc.com> Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index dcb0d76..ff474c7 100

[patch 2/2] ses: invalid free in ses_intf_remove_enclosure()

2015-10-19 Thread Dan Carpenter
If thre aren't any components, then the component[0] is beyond the end of the array. Reported-by: "Berry Cheng 程君(成淼)" <chengmiao...@alibaba-inc.com> Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index f

Re: linux kernel security issuses at ses_enclosure_data_process , ses_intf_remove_enclosure, irlmp_seq_hb_idx report

2015-10-19 Thread Dan Carpenter
Thanks Berry, James, the first two issues are SCSI things. I'm sending patches for them but I can't test them myself. Especially, I'm not positive that [patch 2/2] ses: invalid free in ses_intf_remove_enclosure() is a complete fix. Berry, would it be possible to test that one? regards, dan

[patch] ses: tighten range checks in ses_intf_add()

2015-10-19 Thread Dan Carpenter
We test that "type_ptr" is within the buffer but then we read from "type_ptr[3]" so we could be reading beyond the end of the buffer. Reported-by: "Berry Cheng 程君(成淼)" <chengmiao...@alibaba-inc.com> Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com>

Re: [PATCH] arcmsr: Fix a potential data corruption issue

2015-07-10 Thread Dan Carpenter
if it's necessary, but it seems reasonable to me. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

re: [SCSI] scsi_dh: Update EMC handler

2015-07-11 Thread Dan Carpenter
return sp_model; 261 } regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[patch] mvsas: don't allow negative timeouts

2015-11-13 Thread Dan Carpenter
ng "val" to unsigned. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Checkpatch has several complaints about this code but I left it as-is. diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index 90fdf0e..675e7fa 100644 --- a/drivers/scsi/mvsas/mv_init.

[patch] cxlflash: a couple off by one bugs

2015-09-22 Thread Dan Carpenter
The "> MAX_CONTEXT" should be ">= MAX_CONTEXT". Otherwise we go one step beyond the end of the cfg->ctx_tbl[] array. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superp

[patch RESEND] atp870u: 64 bit bug in atp885_init()

2015-12-09 Thread Dan Carpenter
On 64 bit CPUs there is a memory corruption bug on probe(). It should be a u32 pointer instead of an unsigned long pointer or we write past the end of the setupdata[] array. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> Reviewed-by: Hannes Reinecke <h...@suse.com> --- Resen

[patch] hisi_sas: fix error codes in hisi_sas_task_prep()

2015-12-09 Thread Dan Carpenter
There were a couple cases where the error codes weren't set and also I changed the success return to "return 0;" which is the same as "return rc;" but more explicit. Fixes: 42e7a69368a5 ('hisi_sas: Add ssp command functio') Signed-off-by: Dan Carpenter <dan.carpen...@

Re: [patch RESEND] atp870u: 64 bit bug in atp885_init()

2015-12-09 Thread Dan Carpenter
alone." But these days we just fix it. It's easier to just fix everything instead of trying to decide which bugs are critical. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More maj

Re: [patch RESEND] atp870u: 64 bit bug in atp885_init()

2015-12-09 Thread Dan Carpenter
one will miss it. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 3/4] scsi: storvsc: Refactor the code in storvsc_channel_init()

2015-12-11 Thread Dan Carpenter
>operation = VSTOR_OPERATION_BEGIN_INITIALIZATION; > + ret = storvsc_execute_vstor_op(device, request, true); > + if (ret) > + goto cleanup; 10 lines earlier there is an explicit "return -ENODEV" so it's not as if writing explicit returns will kill you. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/4] scsi: storvsc: Properly support Fibre Channel devices

2015-12-11 Thread Dan Carpenter
coding causes bugs. It does not prevent them. It is a bad style if you believe in measuring, evidence and science. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

re: qla2xxx: ISP27xx add tests for incomplete template.

2015-12-15 Thread Dan Carpenter
89 790 if (buf) { 791 ql_log(ql_log_warn, vha, 0xd015, 792 "Firmware dump saved to temp buffer (%ld/%p)\n", 793 vha->host_no, vha->hw->fw_dump); 794 qla2x00_post_uevent_work(v

Re: [PATCH 1/7] iscsi-target: Use a variable initialisation in iscsi_set_default_param() directly

2015-12-12 Thread Dan Carpenter
ure. 2) It puts a blank line between the allocation and the check for failure. It's like a new paragraph. The allocation and the check should be next to each other. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[patch] qla2xxx: fix a timeout loop

2015-12-16 Thread Dan Carpenter
After the loop we test for "if (!retries) " as a failure, but actually the post-op here will end with retries set to -1. I have fixed this by using a pre-op instead. Fixes: 7ec0effd30bb ('[SCSI] qla2xxx: Add support for ISP8044.') Signed-off-by: Dan Carpenter <dan.carpen...@orac

Re: [PATCH V2 0/4] scsi: storvsc: Properly support FC hosts

2015-12-13 Thread Dan Carpenter
Thanks, K. Y. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [patch RESEND] atp870u: 64 bit bug in atp885_init()

2015-12-09 Thread Dan Carpenter
all atp885 related code, but maybe people are still using it with 32 bit kernels. Or someone could delete it, but I'm not brave enough to be the one to do it. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message

re: qla2xxx: Delete session if initiator is gone from FW

2015-12-22 Thread Dan Carpenter
_schedule_sess_for_deletion(cmd->sess, true); 3599 } 3600 break; 3601 } regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] SCSI-lpfc: Use a signed return type for two functions

2015-12-19 Thread Dan Carpenter
It returns zero or negative error codes. The callers expect int. The current code is harmless. It should return an int. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majo

Re: [patch] qla2xxx: fix a timeout loop

2015-12-17 Thread Dan Carpenter
On Wed, Dec 16, 2015 at 05:50:17PM -0500, Martin K. Petersen wrote: > >>>>> "Dan" == Dan Carpenter <dan.carpen...@oracle.com> writes: > > Dan> After the loop we test for "if (!retries) " as a failure, but > Dan> actually the post-op

[patch] bfa: clean up some bounds checking

2016-06-16 Thread Dan Carpenter
ead one space beyond the end of the buffer and then exit the loop. In the next loop, we increment once, read two characters beyond the end of the buffer and then exit. Then after the loop we put a NUL character two characters past the end of the buffer. Signed-off-by: Dan Carpenter <dan.

re: megaraid_sas: Task management support

2016-02-08 Thread Dan Carpenter
alignment(sdev->request_queue, 0x7); It looks like the code is correct but the patch just deleted a tab accidentally. 1790 mr_device_priv_data->is_tm_capable = 1791 raid->capability.tmCapable; 1792 } regards, dan carpenter -- To uns

re: [SCSI] pmcraid: PMC-Sierra MaxRAID driver to support 6Gb/s SAS RAID controller

2016-01-29 Thread Dan Carpenter
copy_to_user((void *)buffer, 3381 kaddr, 3382 len % bsize_elem); 3383 3384 kunmap(page); 3385 3386 scatterlist[i].length = len % bsize_elem; 3387 } regards, dan carpenter -- To unsubscribe from th

re: lpfc: Modularize and cleanup FDMI code in driver

2016-02-01 Thread Dan Carpenter
sizeof(struct lpfc_name)); lpfc_name is an 8 byte union. 2549 regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org

[patch] bfa: use strncpy() instead of memcpy()

2016-01-30 Thread Dan Carpenter
BFA_MFG_NAME is "QLogic" which is only 7 bytes, but we are copying 8 bytes. It's harmless because the badding byte is likely zero but it makes static checkers complain. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Technically the memset() is not needed because st

re: [SCSI] bfa: Brocade BFA FC SCSI driver

2016-03-11 Thread Dan Carpenter
597 bfa_trc(port->fcs, rport->pwwn); 598 return NULL; 599 } regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info a

[patch] scsi_dh_alua: uninitialized variable in alua_check_vpd()

2016-03-11 Thread Dan Carpenter
The pg_updated variable is support to be set to zero at the start but it is uninitialized. Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/driver

Re: [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd()

2016-03-11 Thread Dan Carpenter
On Fri, Mar 11, 2016 at 11:50:30AM +0100, Hannes Reinecke wrote: > On 03/11/2016 11:17 AM, Dan Carpenter wrote: > > The pg_updated variable is support to be set to zero at the start but > > it is uninitialized. > > > > Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'acces

[patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd()

2016-03-11 Thread Dan Carpenter
The pg_updated variable is support to be set to false at the start but it is uninitialized. Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/driver

re: [SCSI] pm80xx: Phy settings support for motherboard controller.

2016-04-13 Thread Dan Carpenter
65 pm8001_tag_free(pm8001_ha, tag); 4566 } regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH resend v2] [SCSI] bfa: fix bfa_fcb_itnim_alloc() error handling

2016-04-13 Thread Dan Carpenter
The caller assumes that "itnim" is NULL on error and non-NULL on success but really "itnim" is uninitialized on error. This function should just use normal error handling where it returns zero on success and negative on failure. Signed-off-by: Dan Carpenter <dan.carpen...@

re: [SCSI] qla2xxx: Enhancements to support ISPFx00.

2016-04-13 Thread Dan Carpenter
res = bsg_job->reply->result = DID_OK << 16; 2261 bsg_job->reply->reply_payload_rcv_len = 2262 bsg_job->reply_payload.payload_len; 2263 } 2264 sp->done(vha, sp, res);

[patch] tcm_loop: use after free on error

2016-03-02 Thread Dan Carpenter
We dereference "tl_nexus" to get the error code. Fixes: 1b418a8fcbc0 ('target: Convert demo-mode only drivers to target_alloc_session') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop

re: fnic: Using rport->dd_data to check rport online instead of rport_lookup.

2016-04-01 Thread Dan Carpenter
457 if (rport) { ^ The patch adds a check but too late. Probably just delete the check? 458 struct fc_rport_libfc_priv *rp = rport->dd_data; 459 regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-

re: libiscsi: Use scsi helper to set information descriptor

2016-04-13 Thread Dan Carpenter
ILLEGAL_REQUEST, 0x10, ascq); 856 scsi_set_sense_information(sc->sense_buffer, 857 SCSI_SENSE_BUFFERSIZE, 858 sector); 859 goto out

Re: libiscsi: Use scsi helper to set information descriptor

2016-04-13 Thread Dan Carpenter
not needed by no means)? It looks for if there is any possible way that it could be uninitialized so that would solve the problem. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] megaraid: add scsi_cmnd NULL check before use

2016-05-12 Thread Dan Carpenter
trust me." and instead of trusting people I really wish they would just show me the relevant code that prevents it from happening. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More maj

[patch 1/2] mpt3sas: add missing curly braces

2016-05-12 Thread Dan Carpenter
There are some missing curly braces on this if statement, so we end up printing when we shouldn't. Fixes: a470a51cd648 ('mpt3sas: Handle active cable exception event') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/driver

[patch 2/2] mpt3sas: clean up indenting a bit

2016-05-12 Thread Dan Carpenter
The indenting is slightly off in parts of this file so I have tidied it. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 6bff13e..34d6f996 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_s

Re: libiscsi: Use scsi helper to set information descriptor

2016-05-04 Thread Dan Carpenter
} 1151 } 1152 } 1153 1154 return 0; 1155 err: 1156 /* Not alot we can do here, return ambiguous guard error */ 1157 return 0x1; 1158 } regards, dan carpenter -- To unsubscribe from this list: send the line

[patch] [SCSI] aic94xx: silence a static checker warning

2016-05-02 Thread Dan Carpenter
"ddb" is a number between 0-64. It can't ever be >= 0x. But the static checker complains that since we're capping the upper bound, we may as well cap the lower bound and disallow negatives as well. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/d

re: aha1542: Stop using scsi_module.c

2016-05-03 Thread Dan Carpenter
return -ENODEV; 1018 1019 pnp_set_drvdata(pdev, sh); 1020 return 0; 1021 } regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[patch] [SCSI] eata_pio: missing break statement

2016-05-04 Thread Dan Carpenter
This missing break statement bug predates git. It's a very minor thing, it means that we print a '?' instead of a 'z' in dmesg. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c index ca8003f..4299fa4 100644 --- a/driver

[patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg()

2016-04-14 Thread Dan Carpenter
It's possible to use "err" without initializing it. If it happens to be a 2 which is SCSI_DH_RETRY then that could cause a bug. Bart Van Assche pointed out that we should probably re-initialize it for every iteration through the retry loop. Signed-off-by: Dan Carpenter <dan.carpen.

Re: [patch] scsi_dh_alua: uninitialized variable in alua_rtpg()

2016-04-14 Thread Dan Carpenter
On Thu, Apr 14, 2016 at 08:45:18AM -0700, Bart Van Assche wrote: > On 04/14/2016 02:39 AM, Dan Carpenter wrote: > >It's possible to use "err" without initializing it. If it happens to be > >a 2 which is SCSI_DH_RETRY then that could cause a bug. > > > >Sig

[patch] bnx2i: silence uninitialized variable warnings

2016-04-14 Thread Dan Carpenter
Presumably it isn't possible to have empty lists here, but my static checker doesn't know that and complains that "ep" can be used uninitialized. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi

[patch] scsi_dh_alua: uninitialized variable in alua_rtpg()

2016-04-14 Thread Dan Carpenter
It's possible to use "err" without initializing it. If it happens to be a 2 which is SCSI_DH_RETRY then that could cause a bug. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi

  1   2   3   4   5   >