Author: markj
Date: Thu Jul 30 14:50:43 2020
New Revision: 363702
URL: https://svnweb.freebsd.org/changeset/base/363702

Log:
  MFC r363446:
  cuse: Stop checking for failures from malloc(M_WAITOK).

Modified:
  stable/11/sys/fs/cuse/cuse.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/cuse/cuse.c
==============================================================================
--- stable/11/sys/fs/cuse/cuse.c        Thu Jul 30 14:48:48 2020        
(r363701)
+++ stable/11/sys/fs/cuse/cuse.c        Thu Jul 30 14:50:43 2020        
(r363702)
@@ -427,8 +427,6 @@ cuse_server_alloc_memory(struct cuse_server *pcs, uint
        int error;
 
        mem = malloc(sizeof(*mem), M_CUSE, M_WAITOK | M_ZERO);
-       if (mem == NULL)
-               return (ENOMEM);
 
        object = vm_pager_allocate(OBJT_SWAP, NULL, PAGE_SIZE * page_count,
            VM_PROT_DEFAULT, 0, curthread->td_ucred);
@@ -750,8 +748,6 @@ cuse_server_open(struct cdev *dev, int fflags, int dev
        struct cuse_server *pcs;
 
        pcs = malloc(sizeof(*pcs), M_CUSE, M_WAITOK | M_ZERO);
-       if (pcs == NULL)
-               return (ENOMEM);
 
        if (devfs_set_cdevpriv(pcs, &cuse_server_free)) {
                printf("Cuse: Cannot set cdevpriv.\n");
@@ -1219,10 +1215,6 @@ cuse_server_ioctl(struct cdev *dev, unsigned long cmd,
 
                pcsd = malloc(sizeof(*pcsd), M_CUSE, M_WAITOK | M_ZERO);
 
-               if (pcsd == NULL) {
-                       error = ENOMEM;
-                       break;
-               }
                pcsd->server = pcs;
 
                pcsd->user_dev = pcd->dev;
@@ -1432,11 +1424,6 @@ cuse_client_open(struct cdev *dev, int fflags, int dev
        }
 
        pcc = malloc(sizeof(*pcc), M_CUSE, M_WAITOK | M_ZERO);
-       if (pcc == NULL) {
-               /* drop reference on server */
-               cuse_server_unref(pcs);
-               return (ENOMEM);
-       }
        if (devfs_set_cdevpriv(pcc, &cuse_client_free)) {
                printf("Cuse: Cannot set cdevpriv.\n");
                /* drop reference on server */
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to