Showing error 1815

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/message/fusion/mptsas.c
Line in file: 2290
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

2260}
2261
2262/*
2263 * mptsas_delete_expander_phys
2264 *
2265 *
2266 * This will traverse topology, and remove expanders
2267 * that are no longer present
2268 */
2269static void
2270mptsas_delete_expander_phys(MPT_ADAPTER *ioc)
2271{
2272        struct mptsas_portinfo buffer;
2273        struct mptsas_portinfo *port_info, *n, *parent;
2274        struct mptsas_phyinfo *phy_info;
2275        struct sas_port * port;
2276        int i;
2277        u64        expander_sas_address;
2278
2279        mutex_lock(&ioc->sas_topology_mutex);
2280        list_for_each_entry_safe(port_info, n, &ioc->sas_topology, list) {
2281
2282                if (port_info->phy_info &&
2283                    (!(port_info->phy_info[0].identify.device_info &
2284                    MPI_SAS_DEVICE_INFO_SMP_TARGET)))
2285                        continue;
2286
2287                if (mptsas_sas_expander_pg0(ioc, &buffer,
2288                     (MPI_SAS_EXPAND_PGAD_FORM_HANDLE <<
2289                     MPI_SAS_EXPAND_PGAD_FORM_SHIFT),
2290                     port_info->phy_info[0].handle)) {
2291
2292                        /*
2293                         * Obtain the port_info instance to the parent port
2294                         */
2295                        parent = mptsas_find_portinfo_by_handle(ioc,
2296                            port_info->phy_info[0].identify.handle_parent);
2297
2298                        if (!parent)
2299                                goto next_port;
2300
Show full sources