imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,25 +1,22 @@
 static int tz1090_pinctrl_probe(struct platform_device *pdev) {
   struct tz1090_pmx *pmx;
   struct resource *res;
   pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
-  if (!pmx) {
-    dev_err(&pdev->dev, "Can't alloc tz1090_pmx\n");
-    return -ENOMEM;
-  }
+  if (!pmx) return -ENOMEM;
   pmx->dev = &pdev->dev;
   spin_lock_init(&pmx->lock);
   tz1090_pinctrl_desc.name = dev_name(&pdev->dev);
   tz1090_pinctrl_desc.pins = tz1090_pins;
   tz1090_pinctrl_desc.npins = ARRAY_SIZE(tz1090_pins);
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   pmx->regs = devm_ioremap_resource(&pdev->dev, res);
   if (IS_ERR(pmx->regs)) return PTR_ERR(pmx->regs);
   pmx->pctl = devm_pinctrl_register(&pdev->dev, &tz1090_pinctrl_desc, pmx);
   if (IS_ERR(pmx->pctl)) {
     dev_err(&pdev->dev, "Couldn't register pinctrl driver\n");
     return PTR_ERR(pmx->pctl);
   }
   platform_set_drvdata(pdev, pmx);
   dev_info(&pdev->dev, "TZ1090 pinctrl driver initialised\n");
   return 0;
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S1,S2;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL)
- {
- f(...,c,...);
  S1
- }
 else S2
--- initial
+++ final
@@ -1,40 +1,37 @@
 static struct se_portal_group *sbp_make_tpg(struct se_wwn *wwn, struct config_group *group, const char *name) {
   struct sbp_tport *tport = container_of(wwn, struct sbp_tport, tport_wwn);
   struct sbp_tpg *tpg;
   unsigned long tpgt;
   int ret;
   if (strstr(name, "tpgt_") != name) return ERR_PTR(-EINVAL);
   if (kstrtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX) return ERR_PTR(-EINVAL);
   if (tport->tpg) {
     pr_err("Only one TPG per Unit is possible.\n");
     return ERR_PTR(-EBUSY);
   }
   tpg = kzalloc(sizeof(*tpg), GFP_KERNEL);
-  if (!tpg) {
-    pr_err("Unable to allocate struct sbp_tpg\n");
-    return ERR_PTR(-ENOMEM);
-  }
+  if (!tpg) return ERR_PTR(-ENOMEM);
   tpg->tport = tport;
   tpg->tport_tpgt = tpgt;
   tport->tpg = tpg;
   /* default attribute values */
   tport->enable = 0;
   tport->directory_id = -1;
   tport->mgt_orb_timeout = 15;
   tport->max_reconnect_timeout = 5;
   tport->max_logins_per_lun = 1;
   tport->mgt_agt = sbp_management_agent_register(tport);
   if (IS_ERR(tport->mgt_agt)) {
     ret = PTR_ERR(tport->mgt_agt);
     goto out_free_tpg;
   }
   ret = core_tpg_register(wwn, &tpg->se_tpg, SCSI_PROTOCOL_SBP);
   if (ret < 0) goto out_unreg_mgt_agt;
   return &tpg->se_tpg;
 out_unreg_mgt_agt:
   sbp_management_agent_unregister(tport->mgt_agt);
 out_free_tpg:
   tport->tpg = NULL;
   kfree(tpg);
   return ERR_PTR(ret);
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S1,S2;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL)
- {
- f(...,c,...);
  S1
- }
 else S2
--- initial
+++ final
@@ -1,70 +1,66 @@
 static int __init alloc_bus_range(struct bus_node **new_bus, struct range_node **new_range, struct ebda_pci_rsrc *curr, int flag, u8 first_bus) {
   struct bus_node *newbus;
   struct range_node *newrange;
   u8 num_ranges = 0;
   if (first_bus) {
     newbus = kzalloc(sizeof(struct bus_node), GFP_KERNEL);
-    if (!newbus) {
-      err("out of system memory.\n");
-      return -ENOMEM;
-    }
+    if (!newbus) return -ENOMEM;
     newbus->busno = curr->bus_num;
   } else {
     newbus = *new_bus;
     switch (flag) {
     case MEM: num_ranges = newbus->noMemRanges; break;
     case PFMEM: num_ranges = newbus->noPFMemRanges; break;
     case IO: num_ranges = newbus->noIORanges; break;
     }
   }
   newrange = kzalloc(sizeof(struct range_node), GFP_KERNEL);
   if (!newrange) {
     if (first_bus) kfree(newbus);
-    err("out of system memory\n");
     return -ENOMEM;
   }
   newrange->start = curr->start_addr;
   newrange->end = curr->end_addr;
   if (first_bus || (!num_ranges))
     newrange->rangeno = 1;
   else {
     /* need to insert our range */
     add_bus_range(flag, newrange, newbus);
     debug("%d resource Primary Bus inserted on bus %x [%x - %x]\n", flag, newbus->busno, newrange->start, newrange->end);
   }
   switch (flag) {
   case MEM:
     newbus->rangeMem = newrange;
     if (first_bus)
       newbus->noMemRanges = 1;
     else {
       debug("First Memory Primary on bus %x, [%x - %x]\n", newbus->busno, newrange->start, newrange->end);
       ++newbus->noMemRanges;
       fix_resources(newbus);
     }
     break;
   case IO:
     newbus->rangeIO = newrange;
     if (first_bus)
       newbus->noIORanges = 1;
     else {
       debug("First IO Primary on bus %x, [%x - %x]\n", newbus->busno, newrange->start, newrange->end);
       ++newbus->noIORanges;
       fix_resources(newbus);
     }
     break;
   case PFMEM:
     newbus->rangePFMem = newrange;
     if (first_bus)
       newbus->noPFMemRanges = 1;
     else {
       debug("1st PFMemory Primary on Bus %x [%x - %x]\n", newbus->busno, newrange->start, newrange->end);
       ++newbus->noPFMemRanges;
       fix_resources(newbus);
     }
     break;
   }
   *new_bus = newbus;
   *new_range = newrange;
   return 0;
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S1,S2;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL)
- {
- f(...,c,...);
  S1
- }
 else S2

@@
expression x;
identifier f;
constant char[] c;
statement S;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL) {
  ...
- f(...,c,...);
  ...
} else S
--- initial
+++ final
@@ -1,52 +1,43 @@
 static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct resource_node *mem, struct resource_node *pfmem, u8 parent_busno) {
   struct range_node *io_range = NULL;
   struct range_node *mem_range = NULL;
   struct range_node *pfmem_range = NULL;
   struct bus_node *cur_bus = NULL;
   /* Trying to find the parent bus number */
   if (parent_busno != 0xFF) {
     cur_bus = ibmphp_find_res_bus(parent_busno);
     if (!cur_bus) {
       err("strange, cannot find bus which is supposed to be at the system... something is terribly wrong...\n");
       return -ENODEV;
     }
     list_add(&bus->bus_list, &cur_bus->bus_list);
   }
   if (io) {
     io_range = kzalloc(sizeof(*io_range), GFP_KERNEL);
-    if (!io_range) {
-      err("out of system memory\n");
-      return -ENOMEM;
-    }
+    if (!io_range) return -ENOMEM;
     io_range->start = io->start;
     io_range->end = io->end;
     io_range->rangeno = 1;
     bus->noIORanges = 1;
     bus->rangeIO = io_range;
   }
   if (mem) {
     mem_range = kzalloc(sizeof(*mem_range), GFP_KERNEL);
-    if (!mem_range) {
-      err("out of system memory\n");
-      return -ENOMEM;
-    }
+    if (!mem_range) return -ENOMEM;
     mem_range->start = mem->start;
     mem_range->end = mem->end;
     mem_range->rangeno = 1;
     bus->noMemRanges = 1;
     bus->rangeMem = mem_range;
   }
   if (pfmem) {
     pfmem_range = kzalloc(sizeof(*pfmem_range), GFP_KERNEL);
-    if (!pfmem_range) {
-      err("out of system memory\n");
-      return -ENOMEM;
-    }
+    if (!pfmem_range) return -ENOMEM;
     pfmem_range->start = pfmem->start;
     pfmem_range->end = pfmem->end;
     pfmem_range->rangeno = 1;
     bus->noPFMemRanges = 1;
     bus->rangePFMem = pfmem_range;
   }
   return 0;
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S1,S2;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL)
- {
- f(...,c,...);
  S1
- }
 else S2
--- initial
+++ final
@@ -1,36 +1,33 @@
 int msm_pinctrl_probe(struct platform_device *pdev, const struct msm_pinctrl_soc_data *soc_data) {
   struct msm_pinctrl *pctrl;
   struct resource *res;
   int ret;
   pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
-  if (!pctrl) {
-    dev_err(&pdev->dev, "Can't allocate msm_pinctrl\n");
-    return -ENOMEM;
-  }
+  if (!pctrl) return -ENOMEM;
   pctrl->dev = &pdev->dev;
   pctrl->soc = soc_data;
   pctrl->chip = msm_gpio_template;
   raw_spin_lock_init(&pctrl->lock);
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   pctrl->regs = devm_ioremap_resource(&pdev->dev, res);
   if (IS_ERR(pctrl->regs)) return PTR_ERR(pctrl->regs);
   msm_pinctrl_setup_pm_reset(pctrl);
   pctrl->irq = platform_get_irq(pdev, 0);
   if (pctrl->irq < 0) {
     dev_err(&pdev->dev, "No interrupt defined for msmgpio\n");
     return pctrl->irq;
   }
   msm_pinctrl_desc.name = dev_name(&pdev->dev);
   msm_pinctrl_desc.pins = pctrl->soc->pins;
   msm_pinctrl_desc.npins = pctrl->soc->npins;
   pctrl->pctrl = devm_pinctrl_register(&pdev->dev, &msm_pinctrl_desc, pctrl);
   if (IS_ERR(pctrl->pctrl)) {
     dev_err(&pdev->dev, "Couldn't register pinctrl driver\n");
     return PTR_ERR(pctrl->pctrl);
   }
   ret = msm_gpio_init(pctrl);
   if (ret) return ret;
   platform_set_drvdata(pdev, pctrl);
   dev_dbg(&pdev->dev, "Probed Qualcomm pinctrl driver\n");
   return 0;
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S1,S2;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL)
- {
- f(...,c,...);
  S1
- }
 else S2
--- initial
+++ final
@@ -1,51 +1,48 @@
 static int exynos_trng_probe(struct platform_device *pdev) {
   struct exynos_trng_dev *trng;
   struct resource *res;
   int ret = -ENOMEM;
   trng = devm_kzalloc(&pdev->dev, sizeof(*trng), GFP_KERNEL);
   if (!trng) return ret;
   trng->rng.name = devm_kstrdup(&pdev->dev, dev_name(&pdev->dev), GFP_KERNEL);
   if (!trng->rng.name) return ret;
   trng->rng.init = exynos_trng_init;
   trng->rng.read = exynos_trng_do_read;
   trng->rng.priv = (unsigned long)trng;
   platform_set_drvdata(pdev, trng);
   trng->dev = &pdev->dev;
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   trng->mem = devm_ioremap_resource(&pdev->dev, res);
-  if (IS_ERR(trng->mem)) {
-    dev_err(&pdev->dev, "Could not map IO resources.\n");
-    return PTR_ERR(trng->mem);
-  }
+  if (IS_ERR(trng->mem)) return PTR_ERR(trng->mem);
   pm_runtime_enable(&pdev->dev);
   ret = pm_runtime_get_sync(&pdev->dev);
   if (ret < 0) {
     dev_err(&pdev->dev, "Could not get runtime PM.\n");
     goto err_pm_get;
   }
   trng->clk = devm_clk_get(&pdev->dev, "secss");
   if (IS_ERR(trng->clk)) {
     ret = PTR_ERR(trng->clk);
     dev_err(&pdev->dev, "Could not get clock.\n");
     goto err_clock;
   }
   ret = clk_prepare_enable(trng->clk);
   if (ret) {
     dev_err(&pdev->dev, "Could not enable the clk.\n");
     goto err_clock;
   }
   ret = hwrng_register(&trng->rng);
   if (ret) {
     dev_err(&pdev->dev, "Could not register hwrng device.\n");
     goto err_register;
   }
   dev_info(&pdev->dev, "Exynos True Random Number Generator.\n");
   return 0;
 err_register:
   clk_disable_unprepare(trng->clk);
 err_clock:
   pm_runtime_put_sync(&pdev->dev);
 err_pm_get:
   pm_runtime_disable(&pdev->dev);
   return ret;
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S1,S2;
@@

x = devm_ioremap_resource(...);
if (IS_ERR(x))
- {
- f(...,c,...);
  S1
- }
 else S2
--- initial
+++ final
@@ -1,37 +1,34 @@
 int spear_pinctrl_probe(struct platform_device *pdev, struct spear_pinctrl_machdata *machdata) {
   struct device_node *np = pdev->dev.of_node;
   struct resource *res;
   struct spear_pmx *pmx;
   if (!machdata) return -ENODEV;
   pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
-  if (!pmx) {
-    dev_err(&pdev->dev, "Can't alloc spear_pmx\n");
-    return -ENOMEM;
-  }
+  if (!pmx) return -ENOMEM;
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   pmx->vbase = devm_ioremap_resource(&pdev->dev, res);
   if (IS_ERR(pmx->vbase)) return PTR_ERR(pmx->vbase);
   pmx->dev = &pdev->dev;
   pmx->machdata = machdata;
   /* configure mode, if supported by SoC */
   if (machdata->modes_supported) {
     int mode = 0;
     if (of_property_read_u32(np, "st,pinmux-mode", &mode)) {
       dev_err(&pdev->dev, "OF: pinmux mode not passed\n");
       return -EINVAL;
     }
     if (set_mode(pmx, mode)) {
       dev_err(&pdev->dev, "OF: Couldn't configure mode: %x\n", mode);
       return -EINVAL;
     }
   }
   platform_set_drvdata(pdev, pmx);
   spear_pinctrl_desc.pins = machdata->pins;
   spear_pinctrl_desc.npins = machdata->npins;
   pmx->pctl = devm_pinctrl_register(&pdev->dev, &spear_pinctrl_desc, pmx);
   if (IS_ERR(pmx->pctl)) {
     dev_err(&pdev->dev, "Couldn't register pinctrl driver\n");
     return PTR_ERR(pmx->pctl);
   }
   return 0;
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S1,S2;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL)
- {
- f(...,c,...);
  S1
- }
 else S2
--- initial
+++ final
@@ -1,44 +1,42 @@
 static int bnxt_qplib_alloc_dpi_tbl(struct bnxt_qplib_res *res, struct bnxt_qplib_dpi_tbl *dpit, u32 dbr_offset) {
   u32 dbr_bar_reg = RCFW_DBR_PCI_BAR_REGION;
   resource_size_t bar_reg_base;
   u32 dbr_len, bytes;
   if (dpit->dbr_bar_reg_iomem) {
     dev_err(&res->pdev->dev, "QPLIB: DBR BAR region %d already mapped", dbr_bar_reg);
     return -EALREADY;
   }
   bar_reg_base = pci_resource_start(res->pdev, dbr_bar_reg);
   if (!bar_reg_base) {
     dev_err(&res->pdev->dev, "QPLIB: BAR region %d resc start failed", dbr_bar_reg);
     return -ENOMEM;
   }
   dbr_len = pci_resource_len(res->pdev, dbr_bar_reg) - dbr_offset;
   if (!dbr_len || ((dbr_len & (PAGE_SIZE - 1)) != 0)) {
     dev_err(&res->pdev->dev, "QPLIB: Invalid DBR length %d", dbr_len);
     return -ENOMEM;
   }
   dpit->dbr_bar_reg_iomem = ioremap_nocache(bar_reg_base + dbr_offset, dbr_len);
   if (!dpit->dbr_bar_reg_iomem) {
     dev_err(&res->pdev->dev, "QPLIB: FP: DBR BAR region %d mapping failed", dbr_bar_reg);
     return -ENOMEM;
   }
   dpit->unmapped_dbr = bar_reg_base + dbr_offset;
   dpit->max = dbr_len / PAGE_SIZE;
   dpit->app_tbl = kcalloc(dpit->max, sizeof(void *), GFP_KERNEL);
   if (!dpit->app_tbl) {
     pci_iounmap(res->pdev, dpit->dbr_bar_reg_iomem);
-    dev_err(&res->pdev->dev, "QPLIB: DPI app tbl allocation failed");
     return -ENOMEM;
   }
   bytes = dpit->max >> 3;
   if (!bytes) bytes = 1;
   dpit->tbl = kmalloc(bytes, GFP_KERNEL);
   if (!dpit->tbl) {
     pci_iounmap(res->pdev, dpit->dbr_bar_reg_iomem);
     kfree(dpit->app_tbl);
     dpit->app_tbl = NULL;
-    dev_err(&res->pdev->dev, "QPLIB: DPI tbl allocation failed for size = %d", bytes);
     return -ENOMEM;
   }
   memset((u8 *)dpit->tbl, 0xFF, bytes);
   return 0;
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL) {
  ...
- f(...,c,...);
  ...
} else S
--- initial
+++ final
@@ -1,34 +1,31 @@
 static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) {
   int rc;
   struct controller *ctrl;
   if (!is_shpc_capable(pdev)) return -ENODEV;
   ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
-  if (!ctrl) {
-    dev_err(&pdev->dev, "%s: Out of memory\n", __func__);
-    goto err_out_none;
-  }
+  if (!ctrl) goto err_out_none;
   INIT_LIST_HEAD(&ctrl->slot_list);
   rc = shpc_init(ctrl, pdev);
   if (rc) {
     ctrl_dbg(ctrl, "Controller initialization failed\n");
     goto err_out_free_ctrl;
   }
   pci_set_drvdata(pdev, ctrl);
   /* Setup the slot information structures */
   rc = init_slots(ctrl);
   if (rc) {
     ctrl_err(ctrl, "Slot initialization failed\n");
     goto err_out_release_ctlr;
   }
   rc = shpchp_create_ctrl_files(ctrl);
   if (rc) goto err_cleanup_slots;
   return 0;
 err_cleanup_slots:
   cleanup_slots(ctrl);
 err_out_release_ctlr:
   ctrl->hpc_ops->release_ctlr(ctrl);
 err_out_free_ctrl:
   kfree(ctrl);
 err_out_none:
   return -ENODEV;
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S1,S2;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL)
- {
- f(...,c,...);
  S1
- }
 else S2
--- initial
+++ final
@@ -1,40 +1,37 @@
 static int __init once_over(void) {
   struct resource_node *pfmem_cur;
   struct resource_node *pfmem_prev;
   struct resource_node *mem;
   struct bus_node *bus_cur;
   list_for_each_entry(bus_cur, &gbuses, bus_list) {
     if ((!bus_cur->rangePFMem) && (bus_cur->firstPFMem)) {
       for (pfmem_cur = bus_cur->firstPFMem, pfmem_prev = NULL; pfmem_cur; pfmem_prev = pfmem_cur, pfmem_cur = pfmem_cur->next) {
         pfmem_cur->fromMem = 1;
         if (pfmem_prev)
           pfmem_prev->next = pfmem_cur->next;
         else
           bus_cur->firstPFMem = pfmem_cur->next;
         if (!bus_cur->firstPFMemFromMem)
           pfmem_cur->next = NULL;
         else
           /* we don't need to sort PFMemFromMem since we're using mem node for
              all the real work anyways, so just insert at the beginning of the
              list
            */
           pfmem_cur->next = bus_cur->firstPFMemFromMem;
         bus_cur->firstPFMemFromMem = pfmem_cur;
         mem = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
-        if (!mem) {
-          err("out of system memory\n");
-          return -ENOMEM;
-        }
+        if (!mem) return -ENOMEM;
         mem->type = MEM;
         mem->busno = pfmem_cur->busno;
         mem->devfunc = pfmem_cur->devfunc;
         mem->start = pfmem_cur->start;
         mem->end = pfmem_cur->end;
         mem->len = pfmem_cur->len;
         if (ibmphp_add_resource(mem) < 0) err("Trouble...trouble... EBDA allocated pfmem from mem, but system doesn't display it has this space... unless not PCI device...\n");
         pfmem_cur->rangeno = mem->rangeno;
       } /* end for pfmem */
     }   /* end if */
   }     /* end list_for_each bus */
   return 0;
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S1,S2;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL)
- {
- f(...,c,...);
  S1
- }
 else S2
--- initial
+++ final
@@ -1,15 +1,12 @@
 static int wm8750_pinctrl_probe(struct platform_device *pdev) {
   struct wmt_pinctrl_data *data;
   data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
-  if (!data) {
-    dev_err(&pdev->dev, "failed to allocate data\n");
-    return -ENOMEM;
-  }
+  if (!data) return -ENOMEM;
   data->banks = wm8750_banks;
   data->nbanks = ARRAY_SIZE(wm8750_banks);
   data->pins = wm8750_pins;
   data->npins = ARRAY_SIZE(wm8750_pins);
   data->groups = wm8750_groups;
   data->ngroups = ARRAY_SIZE(wm8750_groups);
   return wmt_pinctrl_probe(pdev, data);
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S1,S2;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL)
- {
- f(...,c,...);
  S1
- }
 else S2
--- initial
+++ final
@@ -1,45 +1,42 @@
 int exynos_g2d_exec_ioctl(struct drm_device *drm_dev, void *data, struct drm_file *file) {
   struct drm_exynos_file_private *file_priv = file->driver_priv;
   struct exynos_drm_g2d_private *g2d_priv = file_priv->g2d_priv;
   struct device *dev;
   struct g2d_data *g2d;
   struct drm_exynos_g2d_exec *req = data;
   struct g2d_runqueue_node *runqueue_node;
   struct list_head *run_cmdlist;
   struct list_head *event_list;
   if (!g2d_priv) return -ENODEV;
   dev = g2d_priv->dev;
   if (!dev) return -ENODEV;
   g2d = dev_get_drvdata(dev);
   if (!g2d) return -EFAULT;
   runqueue_node = kmem_cache_alloc(g2d->runqueue_slab, GFP_KERNEL);
-  if (!runqueue_node) {
-    dev_err(dev, "failed to allocate memory\n");
-    return -ENOMEM;
-  }
+  if (!runqueue_node) return -ENOMEM;
   run_cmdlist = &runqueue_node->run_cmdlist;
   event_list = &runqueue_node->event_list;
   INIT_LIST_HEAD(run_cmdlist);
   INIT_LIST_HEAD(event_list);
   init_completion(&runqueue_node->complete);
   runqueue_node->async = req->async;
   list_splice_init(&g2d_priv->inuse_cmdlist, run_cmdlist);
   list_splice_init(&g2d_priv->event_list, event_list);
   if (list_empty(run_cmdlist)) {
     dev_err(dev, "there is no inuse cmdlist\n");
     kmem_cache_free(g2d->runqueue_slab, runqueue_node);
     return -EPERM;
   }
   mutex_lock(&g2d->runqueue_mutex);
   runqueue_node->pid = current->pid;
   runqueue_node->filp = file;
   list_add_tail(&runqueue_node->list, &g2d->runqueue);
   mutex_unlock(&g2d->runqueue_mutex);
   /* Let the runqueue know that there is work to do. */
   queue_work(g2d->g2d_workq, &g2d->runqueue_work);
   if (runqueue_node->async) goto out;
   wait_for_completion(&runqueue_node->complete);
   g2d_free_runqueue_node(g2d, runqueue_node);
 out:
   return 0;
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S1,S2;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL)
- {
- f(...,c,...);
  S1
- }
 else S2
--- initial
+++ final
@@ -1,45 +1,44 @@
 static int __init ibmphp_init(void) {
   struct pci_bus *bus;
   int i = 0;
   int rc = 0;
   init_flag = 1;
   info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
   ibmphp_pci_bus = kmalloc(sizeof(*ibmphp_pci_bus), GFP_KERNEL);
   if (!ibmphp_pci_bus) {
-    err("out of memory\n");
     rc = -ENOMEM;
     goto exit;
   }
   bus = pci_find_bus(0, 0);
   if (!bus) {
     err("Can't find the root pci bus, can not continue\n");
     rc = -ENODEV;
     goto error;
   }
   memcpy(ibmphp_pci_bus, bus, sizeof(*ibmphp_pci_bus));
   ibmphp_debug = debug;
   ibmphp_hpc_initvars();
   for (i = 0; i < 16; i++)
     irqs[i] = 0;
   rc = ibmphp_access_ebda();
   if (rc) goto error;
   debug("after ibmphp_access_ebda()\n");
   rc = ibmphp_rsrc_init();
   if (rc) goto error;
   debug("AFTER Resource & EBDA INITIALIZATIONS\n");
   max_slots = get_max_slots();
   rc = ibmphp_register_pci();
   if (rc) goto error;
   if (init_ops()) {
     rc = -ENODEV;
     goto error;
   }
   ibmphp_print_test();
   rc = ibmphp_hpc_start_poll_thread();
   if (rc) goto error;
 exit:
   return rc;
 error:
   ibmphp_unload();
   goto exit;
 }<sep>@@
expression x;
identifier f;
constant char[] c;
statement S;
@@

x = \(kmalloc\|kcalloc\|kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kzalloc
	\|kmemdup\|kmem_cache_alloc\|kmem_cache_zalloc
	\|rhashtable_lookup_fast\)
      (...);
if (x == NULL) {
  ...
- f(...,c,...);
  ...
} else S