Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178224262
D60319.1796280746.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D60319.1796280746.diff
View Options
Index: sys/dev/mpi3mr/mpi3mr.c
===================================================================
--- sys/dev/mpi3mr/mpi3mr.c
+++ sys/dev/mpi3mr/mpi3mr.c
@@ -2556,7 +2556,6 @@
static int mpi3mr_alloc_chain_bufs(struct mpi3mr_softc *sc)
{
- int retval = 0;
U32 sz, i;
U16 num_chains;
@@ -2570,8 +2569,7 @@
if (!sc->chain_sgl_list) {
printf(IOCNAME "Cannot allocate memory for chain SGL list\n",
sc->name);
- retval = -1;
- goto out_failed;
+ return (-1);
}
if (sc->max_sgl_entries > sc->facts.max_data_length / PAGE_SIZE)
@@ -2613,21 +2611,9 @@
sc->chain_bitmap = malloc(sc->chain_bitmap_sz, M_MPI3MR, M_NOWAIT | M_ZERO);
if (!sc->chain_bitmap) {
mpi3mr_dprint(sc, MPI3MR_INFO, "Cannot alloc memory for chain bitmap\n");
- retval = -1;
- goto out_failed;
- }
- return retval;
-
-out_failed:
- for (i = 0; i < num_chains; i++) {
- if (sc->chain_sgl_list[i].buf_phys != 0)
- bus_dmamap_unload(sc->chain_sgl_list_tag, sc->chain_sgl_list[i].buf_dmamap);
- if (sc->chain_sgl_list[i].buf != NULL)
- bus_dmamem_free(sc->chain_sgl_list_tag, sc->chain_sgl_list[i].buf, sc->chain_sgl_list[i].buf_dmamap);
+ return (-1);
}
- if (sc->chain_sgl_list_tag != NULL)
- bus_dma_tag_destroy(sc->chain_sgl_list_tag);
- return retval;
+ return (0);
}
static int mpi3mr_pel_alloc(struct mpi3mr_softc *sc)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 3, 6:52 AM (20 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42174592
Default Alt Text
D60319.1796280746.diff (1 KB)
Attached To
Mode
D60319: mpi3mr: Fix null pointer dereference during chain buffer allocation failure
Attached
Detach File
Event Timeline