Print this page
12276 smatch-clean sockfs

@@ -1138,14 +1138,10 @@
                 first = B_FALSE;
         }
 
         alloc = kmem_alloc(sz, KM_SLEEP);
         URI_RD_ADD(uri, rdp, sz, -1);
-        if (rdp == NULL) {
-                error = ENOMEM;
-                goto fail;
-        }
 
         if (uri->hash != URI_TEMP && uri->count > nca_max_cache_size) {
                 uri_delete(uri);
                 uri->hash = URI_TEMP;
         }

@@ -1374,14 +1370,10 @@
 
                         releasef(sfvp->sfv_fd);
                         fp = NULL;
                 }
                 URI_RD_ADD(uri, rdp, cnt, -1);
-                if (rdp == NULL) {
-                        error = ENOMEM;
-                        goto fail;
-                }
                 data = alloc;
                 alloc = NULL;
                 rdp->data.kmem = data;
                 total_count += cnt;
                 if (uri->hash != URI_TEMP && total_count > nca_max_cache_size) {

@@ -1403,14 +1395,10 @@
                          * File descriptor, if any bytes left save vnode_t.
                          */
                         if (len > cnt) {
                                 /* More file data so add it */
                                 URI_RD_ADD(uri, rdp, len - cnt, off);
-                                if (rdp == NULL) {
-                                        error = ENOMEM;
-                                        goto fail;
-                                }
                                 rdp->data.vnode = vp;
 
                                 /* Send vnode data out the connection */
                                 error = uri_rd_response(so, uri, rdp, first);
                         } else {