+ jbd-avoid-kfree-null.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     jbd: avoid kfree(NULL)

has been added to the -mm tree.  Its filename is

     jbd-avoid-kfree-null.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this


From: Andrew Morton <akpm@xxxxxxxx>

There are a couple of places where JBD has to check to see whether an unneeded
memory allocation was performed.  Usually it _was_ needed, so we end up
calling kfree(NULL).  We can micro-optimise that by checking the pointer
before calling kfree().


Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/jbd/transaction.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN fs/jbd/transaction.c~jbd-avoid-kfree-null fs/jbd/transaction.c
--- devel/fs/jbd/transaction.c~jbd-avoid-kfree-null	2006-04-21 12:27:22.000000000 -0700
+++ devel-akpm/fs/jbd/transaction.c	2006-04-21 12:32:20.000000000 -0700
@@ -227,7 +227,8 @@ repeat_locked:
 	spin_unlock(&transaction->t_handle_lock);
 	spin_unlock(&journal->j_state_lock);
 out:
-	kfree(new_transaction);
+	if (unlikely(new_transaction))		/* It's usually NULL */
+		kfree(new_transaction);
 	return ret;
 }
 
@@ -724,7 +725,8 @@ done:
 	journal_cancel_revoke(handle, jh);
 
 out:
-	kfree(frozen_buffer);
+	if (unlikely(frozen_buffer))	/* It's usually NULL */
+		kfree(frozen_buffer);
 
 	JBUFFER_TRACE(jh, "exit");
 	return error;
_

Patches currently in -mm which might be from akpm@xxxxxxxx are

origin.patch
config_net=n-build-fix.patch
git-acpi.patch
acpi-update-asus_acpi-driver-registration-fix.patch
acpi-memory-hotplug-cannot-manage-_crs-with-plural-resoureces.patch
catch-notification-of-memory-add-event-of-acpi-via-container-driver-register-start-func-for-memory-device.patch
catch-notification-of-memory-add-event-of-acpi-via-container-driveravoid-redundant-call-add_memory.patch
sony_apci-resume.patch
powernow-k8-crash-workaround.patch
git-dvb.patch
dvb-core-ule-fixes-and-rfc4326-additions-kernel-2616-tidy.patch
sparc32-vivi-fix.patch
git-dvb-compat-build-fix.patch
bt866-build-fix.patch
connector-exports.patch
git-libata-all.patch
git-mtd.patch
pci-error-recovery-e1000-network-device-driver.patch
git-net.patch
gregkh-pci-pci-64-bit-resources-drivers-others-changes-amba-fix.patch
git-pcmcia.patch
git-scsi-misc.patch
megaraid-unused-variable.patch
enable-advansys-driver.patch
advansys-warning-workaround.patch
scsi-clean-up-warnings-in-advansys-driver-fix.patch
git-watchdog.patch
arm-add_memory-build-fix.patch
pg_uncached-is-ia64-only.patch
migration-remove-unnecessary-pageswapcache-checks-fix.patch
wait_table-and-zonelist-initializing-for-memory-hotadd-wait_table-initialization-fixes.patch
preserve-write-permissions-in-migration-entries-fix.patch
read-write-migration-entries-make-mprotect-convert-write-migration-fix.patch
read-write-migration-entries-make-mprotect-convert-write-migration-fix-fix.patch
read-write-migration-entries-make-mprotect-convert-write-migration-fix-fix-fix.patch
slab-cleanup-kmem_getpages-fix.patch
slab-stop-using-list_for_each-fix.patch
pgdat-allocation-for-new-node-add-specify-node-id-tidy.patch
pgdat-allocation-for-new-node-add-get-node-id-by-acpi-tidy.patch
pgdat-allocation-for-new-node-add-generic-alloc-node_data-tidy.patch
pgdat-allocation-for-new-node-add-export-kswapd-start-func-tidy.patch
mm-remap_vmalloc_range-fix.patch
acx1xx-wireless-driver.patch
x86-x86_64-avoid-irq0-ioapic-pin-collision-tidy.patch
prune_one_dentry-tweaks.patch
mmput-might-sleep.patch
tpm-use-clear_bit-fix.patch
tpm-use-clear_bit-fix-fix.patch
tpm-use-clear_bit-fix-fix-fix-fix.patch
hangcheck-remove-monotomic_clock-on-x86.patch
pi-futex-futex-code-cleanups-fix.patch
reiser4.patch
kgdb-core-lite-add-reboot-command.patch
kgdb-8250-fix.patch
nr_blockdev_pages-in_interrupt-warning.patch
device-suspend-debug.patch
revert-tty-buffering-comment-out-debug-code.patch
slab-leaks3-default-y.patch
x86-kmap_atomic-debugging.patch
jbd-avoid-kfree-null.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux