mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luis Henriques <luis.henriques@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	kernel-team@lists.ubuntu.com
Cc: James Hogan <james.hogan@imgtec.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Gleb Natapov <gleb@kernel.org>,
	kvm@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>,
	linux-mips@linux-mips.org, Sanjay Lal <sanjayl@kymasys.com>,
	Luis Henriques <luis.henriques@canonical.com>
Subject: [PATCH 3.11 002/128] MIPS: KVM: Remove redundant NULL checks before kfree()
Date: Thu, 24 Jul 2014 10:44:11 +0100	[thread overview]
Message-ID: <1406195177-8656-3-git-send-email-luis.henriques@canonical.com> (raw)
In-Reply-To: <1406195177-8656-1-git-send-email-luis.henriques@canonical.com>

3.11.10.14 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: James Hogan <james.hogan@imgtec.com>

commit c6c0a6637f9da54f9472144d44f71cf847f92e20 upstream.

The kfree() function already NULL checks the parameter so remove the
redundant NULL checks before kfree() calls in arch/mips/kvm/.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: kvm@vger.kernel.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: Sanjay Lal <sanjayl@kymasys.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/mips/kvm/kvm_mips.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/arch/mips/kvm/kvm_mips.c b/arch/mips/kvm/kvm_mips.c
index 426345ac6f6e..7e78af0e57de 100644
--- a/arch/mips/kvm/kvm_mips.c
+++ b/arch/mips/kvm/kvm_mips.c
@@ -149,9 +149,7 @@ void kvm_mips_free_vcpus(struct kvm *kvm)
 		if (kvm->arch.guest_pmap[i] != KVM_INVALID_PAGE)
 			kvm_mips_release_pfn_clean(kvm->arch.guest_pmap[i]);
 	}
-
-	if (kvm->arch.guest_pmap)
-		kfree(kvm->arch.guest_pmap);
+	kfree(kvm->arch.guest_pmap);
 
 	kvm_for_each_vcpu(i, vcpu, kvm) {
 		kvm_arch_vcpu_free(vcpu);
@@ -384,12 +382,8 @@ void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
 
 	kvm_mips_dump_stats(vcpu);
 
-	if (vcpu->arch.guest_ebase)
-		kfree(vcpu->arch.guest_ebase);
-
-	if (vcpu->arch.kseg0_commpage)
-		kfree(vcpu->arch.kseg0_commpage);
-
+	kfree(vcpu->arch.guest_ebase);
+	kfree(vcpu->arch.kseg0_commpage);
 }
 
 void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
-- 
1.9.1


  parent reply	other threads:[~2014-07-24  9:46 UTC|newest]

Thread overview: 132+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-24  9:44 [3.11.y.z extended stable] Linux 3.11.10.14 stable review Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 001/128] sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue Luis Henriques
2014-07-24  9:44 ` Luis Henriques [this message]
2014-07-24  9:44 ` [PATCH 3.11 003/128] MIPS: KVM: Fix memory leak on VCPU Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 004/128] btrfs: Add ctime/mtime update for btrfs device add/remove Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 005/128] Btrfs: output warning instead of error when loading free space cache failed Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 006/128] Btrfs: make sure there are not any read requests before stopping workers Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 007/128] Btrfs: fix NULL pointer crash of deleting a seed device Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 008/128] Btrfs: mark mapping with error flag to report errors to userspace Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 009/128] Btrfs: set right total device count for seeding support Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 010/128] Btrfs: send, don't error in the presence of subvols/snapshots Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 011/128] fs: btrfs: volumes.c: Fix for possible null pointer dereference Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 012/128] Btrfs: use right type to get real comparison Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 013/128] Btrfs: fix scrub_print_warning to handle skinny metadata extents Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 014/128] btrfs: fix use of uninit "ret" in end_extent_writepage() Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 015/128] Bluetooth: Fix check for connection encryption Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 016/128] Bluetooth: Fix SSP acceptor just-works confirmation without MITM Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 017/128] Bluetooth: Fix indicating discovery state when canceling inquiry Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 018/128] Bluetooth: Fix locking of hdev when calling into SMP code Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 019/128] Bluetooth: Allow change security level on ATT_CID in slave role Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 020/128] rt2x00: disable TKIP on USB Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 021/128] b43: fix frequency reported on G-PHY with /new/ firmware Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 022/128] rt2x00: fix rfkill regression on rt2500pci Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 023/128] tracing: Fix syscall_*regfunc() vs copy_process() race Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 024/128] blkcg: fix use-after-free in __blkg_release_rcu() by making blkcg_gq refcnt an atomic_t Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 025/128] rbd: handle parent_overlap on writes correctly Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 026/128] lz4: ensure length does not wrap Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 027/128] mm, pcp: allow restoring percpu_pagelist_fraction default Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 028/128] mm: fix crashes from mbind() merging vmas Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 029/128] [CIFS] fix mount failure with broken pathnames when smb3 mount with mapchars option Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 030/128] drm: fix NULL pointer access by wrong ioctl Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 031/128] net: allwinner: emac: Add missing free_irq Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 032/128] ALSA: usb-audio: Fix races at disconnection and PCM closing Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 033/128] recordmcount/MIPS: Fix possible incorrect mcount_loc table entries in modules Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 034/128] MIPS: MSC: Prevent out-of-bounds writes to MIPS SC ioremap'd region Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 035/128] target: Fix left-over se_lun->lun_sep pointer OOPs Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 036/128] iscsi-target: Explicily clear login response PDU in exception path Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 037/128] efi-pstore: Fix an overflow on 32-bit builds Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 038/128] lz4: fix another possible overrun Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 039/128] iscsi-target: Avoid rejecting incorrect ITT for Data-Out Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 040/128] powerpc: fix typo 'CONFIG_PPC_CPU' Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 041/128] powerpc: fix typo 'CONFIG_PMAC' Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 042/128] PCI: Fix incorrect vgaarb conditional in WARN_ON() Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 043/128] ptrace,x86: force IRET path after a ptrace_stop() Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 044/128] mei: me: fix hw ready reset flow Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 045/128] tracing: Try again for saved cmdline if failed due to locking Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 046/128] ring-buffer: Check if buffer exists before polling Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 047/128] Score: Implement the function csum_ipv6_magic Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 048/128] Score: The commit is for compiling successfully Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 049/128] Score: Modify the Makefile of Score, remove -mlong-calls for compiling Luis Henriques
2014-07-24  9:44 ` [PATCH 3.11 050/128] ext4: Fix buffer double free in ext4_alloc_branch() Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 051/128] ARM: OMAP2+: Fix parser-bug in platform muxing code Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 052/128] KVM: x86: Increase the number of fixed MTRR regs to 10 Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 053/128] KVM: x86: preserve the high 32-bits of the PAT register Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 054/128] usb: musb: ux500: don't propagate the OF node Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 055/128] usb: gadget: f_fs: fix NULL pointer dereference when there are no strings Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 056/128] iio: of_iio_channel_get_by_name() returns non-null pointers for error legs Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 057/128] irqchip: spear_shirq: Fix interrupt offset Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 058/128] USB: option: add device ID for SpeedUp SU9800 usb 3g modem Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 059/128] USB: ftdi_sio: fix null deref at port probe Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 060/128] usb: option: add/modify Olivetti Olicard modems Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 061/128] xhci: correct burst count field for isoc transfers on 1.0 xhci hosts Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 062/128] xhci: clear root port wake on bits if controller isn't wake-up capable Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 063/128] xhci: Fix runtime suspended xhci from blocking system suspend Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 064/128] ibmvscsi: Abort init sequence during error recovery Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 065/128] ibmvscsi: Add memory barriers for send / receive Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 066/128] virtio-scsi: avoid cancelling uninitialized work items Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 067/128] virtio-scsi: fix various bad behavior on aborted requests Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 068/128] ext4: Fix hole punching for files with indirect blocks Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 069/128] nfsd: fix rare symlink decoding bug Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 070/128] tools: ffs-test: fix header values endianess Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 071/128] drm/radeon/dpm: fix typo in vddci setup for eg/btc Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 072/128] drm/radeon/dpm: fix vddci setup typo on cayman Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 073/128] tracing: Remove ftrace_stop/start() from reading the trace file Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 074/128] usb: chipidea: udc: delete td from req's td list at ep_dequeue Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 075/128] drm/radeon/cik: fix typo in EOP packet Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 076/128] md: flush writes before starting a recovery Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 077/128] drm/vmwgfx: Fix incorrect write to read-only register v2: Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 078/128] mm: page_alloc: fix CMA area initialisation when pageblock > MAX_ORDER Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 079/128] /proc/stat: convert to single_open_size() Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 080/128] lz4: add overrun checks to lz4_uncompress_unknownoutputsize() Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 081/128] arm64: mm: Make icache synchronisation logic huge page aware Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 082/128] rtmutex: Detect changes in the pi lock chain Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 083/128] rtmutex: Plug slow unlock race Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 084/128] ARC: Implement ptrace(PTRACE_GET_THREAD_AREA) Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 085/128] mac80211: fix IBSS join by initializing last_scan_completed Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 086/128] [SCSI] Fix spurious request sense in error handling Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 087/128] ipvs: stop tot_stats estimator only under CONFIG_SYSCTL Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 088/128] netfilter: nf_nat: fix oops on netns removal Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 089/128] workqueue: fix dev_set_uevent_suppress() imbalance Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 090/128] cpuset,mempolicy: fix sleeping function called from invalid context Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 091/128] crypto: sha512_ssse3 - fix byte count to bit count conversion Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 092/128] thermal: hwmon: Make the check for critical temp valid consistent Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 093/128] hwmon: (amc6821) Fix permissions for temp2_input Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 094/128] hwmon: (adm1029) Ensure the fan_div cache is updated in set_fan_div Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 095/128] hwmon: (adm1021) Fix cache problem when writing temperature limits Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 096/128] ext4: fix unjournalled bg descriptor while initializing inode bitmap Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 097/128] ext4: clarify error count warning messages Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 098/128] ext4: disable synchronous transaction batching if max_batch_time==0 Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 099/128] intel_pstate: Set CPU number before accessing MSRs Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 100/128] USB: cp210x: add support for Corsair usb dongle Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 101/128] usb: option: Add ID for Telewell TW-LTE 4G v2 Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 102/128] ACPI / EC: Avoid race condition related to advance_transaction() Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 103/128] ACPI / EC: Add asynchronous command byte write support Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 104/128] ACPI / EC: Remove duplicated ec_wait_ibf0() waiter Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 105/128] ACPI / EC: Fix race condition in ec_transaction_completed() Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 106/128] ACPI / battery: Retry to get battery information if failed during probing Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 107/128] hwmon: (adm1031) Fix writes to limit registers Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 108/128] workqueue: zero cpumask of wq_numa_possible_cpumask on init Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 109/128] hwmon: (emc2103) Fix return value Luis Henriques
2014-07-24  9:45 ` [PATCH 3.11 110/128] hwmon: (emc2103) Clamp limits instead of bailing out Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 111/128] arm64: implement TASK_SIZE_OF Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 112/128] iio: ti_am335x_adc: Fix: Use same step id at FIFOs both ends Luis Henriques
2014-07-25 11:13   ` [PATCH] iio: ti_am335x_adc: Fix prerequisite for stepid patch Jan Kardell
2014-07-28 10:05     ` Luis Henriques
2014-08-08  8:24       ` Jonathan Cameron
2014-07-24  9:46 ` [PATCH 3.11 113/128] cpufreq: Makefile: fix compilation for davinci platform Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 114/128] Drivers: hv: vmbus: Fix a bug in the channel callback dispatch code Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 115/128] USB: ftdi_sio: Add extra PID Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 116/128] dm io: fix a race condition in the wake up code for sync_io Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 117/128] drm/radeon: fix typo in golden register setup on evergreen Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 118/128] drm/radeon/dpm: Reenabling SS on Cayman Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 119/128] powerpc/perf: Add PPMU_ARCH_207S define Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 120/128] powerpc/perf: Clear MMCR2 when enabling PMU Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 121/128] powerpc/perf: Never program book3s PMCs with values >= 0x80000000 Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 122/128] USB: serial: ftdi_sio: Add Infineon Triboard Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 123/128] clk: spear3xx: Use proper control register offset Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 124/128] x86, ioremap: Speed up check for RAM pages Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 125/128] rbd: use reference counts for image requests Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 126/128] Don't trigger congestion wait on dirty-but-not-writeout pages Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 127/128] hugetlb: fix copy_hugetlb_page_range() to handle migration/hwpoisoned entry Luis Henriques
2014-07-24  9:46 ` [PATCH 3.11 128/128] mm: hugetlb: fix copy_hugetlb_page_range() Luis Henriques

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1406195177-8656-3-git-send-email-luis.henriques@canonical.com \
    --to=luis.henriques@canonical.com \
    --cc=gleb@kernel.org \
    --cc=james.hogan@imgtec.com \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=pbonzini@redhat.com \
    --cc=ralf@linux-mips.org \
    --cc=sanjayl@kymasys.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®