Showing error 1645

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/pci/hotplug/acpiphp_ibm.c
Line in file: 191
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 07:54:05 UTC


Source:

161        if (ind < size && des->slot.slot_num == id)
162                ret = des;
163
164ibm_slot_done:
165        if (ret) {
166                ret = kmalloc(sizeof(union apci_descriptor), GFP_KERNEL);
167                memcpy(ret, des, sizeof(union apci_descriptor));
168        }
169        kfree(table);
170        return ret;
171}
172
173/**
174 * ibm_set_attention_status - callback method to set the attention LED
175 * @slot: the hotplug_slot to work with
176 * @status: what to set the LED to (0 or 1)
177 *
178 * Description: This method is registered with the acpiphp module as a
179 * callback to do the device specific task of setting the LED status.
180 */
181static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
182{
183        union acpi_object args[2]; 
184        struct acpi_object_list params = { .pointer = args, .count = 2 };
185        acpi_status stat; 
186        unsigned long long rc;
187        union apci_descriptor *ibm_slot;
188
189        ibm_slot = ibm_slot_from_id(hpslot_to_sun(slot));
190
191        dbg("%s: set slot %d (%d) attention status to %d\n", __func__,
192                        ibm_slot->slot.slot_num, ibm_slot->slot.slot_id,
193                        (status ? 1 : 0));
194
195        args[0].type = ACPI_TYPE_INTEGER;
196        args[0].integer.value = ibm_slot->slot.slot_id;
197        args[1].type = ACPI_TYPE_INTEGER;
198        args[1].integer.value = (status) ? 1 : 0;
199
200        kfree(ibm_slot);
201
Show full sources