Print this page
6147 segop_getpolicy already checks for a NULL op
Reviewed by: Garrett D'Amore <garrett@damore.org>

@@ -3499,11 +3499,10 @@
  * Get memory allocation policy for this segment
  */
 lgrp_mem_policy_info_t *
 lgrp_mem_policy_get(struct seg *seg, caddr_t vaddr)
 {
-        lgrp_mem_policy_info_t  *policy_info;
         extern struct seg_ops   segspt_ops;
         extern struct seg_ops   segspt_shmops;
 
         /*
          * This is for binary compatibility to protect against third party

@@ -3512,15 +3511,11 @@
          */
         if (seg->s_ops != &segvn_ops && seg->s_ops != &segspt_ops &&
             seg->s_ops != &segspt_shmops)
                 return (NULL);
 
-        policy_info = NULL;
-        if (seg->s_ops->getpolicy != NULL)
-                policy_info = segop_getpolicy(seg, vaddr);
-
-        return (policy_info);
+        return (segop_getpolicy(seg, vaddr));
 }
 
 /*
  * Set policy for allocating private memory given desired policy, policy info,
  * size in bytes of memory that policy is being applied.