lkml.org 
[lkml]   [2008]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mptsas: remove pointless null check
From
Date
On Mon, 2008-10-13 at 15:05 +0100, Alan Cox wrote:
> mptsas: remove unneeded check
>
> From: Alan Cox <alan@redhat.com>
>
> >From coverity checker. Closes #9675
>
> Signed-off-by: Alan Cox <alan@redhat.com>
> ---
>
> drivers/message/fusion/mptsas.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)

-EWRONGLIST

This is a SCSI patch (although I admit with fusion sitting in
drivers/message it's hard to tell without looking in the MAINTAINERS
file).

>
> diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
> index 12b7325..a9019f0 100644
> --- a/drivers/message/fusion/mptsas.c
> +++ b/drivers/message/fusion/mptsas.c
> @@ -2279,9 +2279,8 @@ mptsas_delete_expander_phys(MPT_ADAPTER *ioc)
> mutex_lock(&ioc->sas_topology_mutex);
> list_for_each_entry_safe(port_info, n, &ioc->sas_topology, list) {
>
> - if (port_info->phy_info &&

If I remember rightly this check is necessary because phy_info can be
NULL in certain situations. Your patch will trip this to oops. What
your description needs to say is that we no longer need to check this
pointer for NULL because it was checked somewhere else in the stack ...
but I can't see where that is, where is it?

> - (!(port_info->phy_info[0].identify.device_info &
> - MPI_SAS_DEVICE_INFO_SMP_TARGET)))
> + if (!(port_info->phy_info[0].identify.device_info &
> + MPI_SAS_DEVICE_INFO_SMP_TARGET))
> continue;
>
> if (mptsas_sas_expander_pg0(ioc, &buffer,

James




\
 
 \ /
  Last update: 2008-10-13 16:25    [W:0.255 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site