From patchwork Sun Mar 10 22:39:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Grad X-Patchwork-Id: 226472 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 2E25A2C0359 for ; Mon, 11 Mar 2013 09:40:43 +1100 (EST) Received: from mail-ea0-x22f.google.com (mail-ea0-x22f.google.com [IPv6:2a00:1450:4013:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id A5B122C02F0 for ; Mon, 11 Mar 2013 09:40:14 +1100 (EST) Received: by mail-ea0-f175.google.com with SMTP id o10so883252eaj.6 for ; Sun, 10 Mar 2013 15:40:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=wGsok5TWskBcilV5Ku/lXGrMG4SiwjLQ2wnRUiXJm2A=; b=pvVcYZTbKKtn55/dnZCukB0hmtioMott1b3N+n+ZcoU27TvwBXGT2Ml+oFT/9QPIRT WAV5i2r4OMEGl7j4lPo5dWZoi3GaGwnw0PsQk6Mey9aL5ilXBNDwQ48X6e7A1seJYRon AokN30YiQZGf+GwxOgCJMnv9dp8zVvJU+Io9N4ACKTLeSmfq69XqCXdtzxnje4GTZmkM CD9CyC8q5yX9c8Xk9qyvjGOutxelAp4rO7Y5zDNhTTdC32Ukxjxh4MvPLHKMnfkBN1ot uu0pqs0G/IQW5kANDkEenODU/MG3d8ovkhi1QtNyHjQvGPfU6okJ8boqQ4PlXpIbTAyU /Zrw== X-Received: by 10.14.216.198 with SMTP id g46mr15340167eep.30.1362955210063; Sun, 10 Mar 2013 15:40:10 -0700 (PDT) Received: from localhost.localdomain ([188.25.149.17]) by mx.google.com with ESMTPS id m46sm20249802eeo.16.2013.03.10.15.40.08 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 10 Mar 2013 15:40:09 -0700 (PDT) From: Alex Grad To: penberg@kernel.org Subject: [PATCH]->[PATCH v2] kgdb: Removed kmalloc returned value cast Date: Mon, 11 Mar 2013 00:39:48 +0200 Message-Id: <1362955188-3023-1-git-send-email-alex.grad@gmail.com> X-Mailer: git-send-email 1.7.10.4 Cc: sfr@canb.auug.org.au, mikey@neuling.org, daniel.baluta@gmail.com, linux-kernel@vger.kernel.org, tiejun.chen@windriver.com, paulus@samba.org, Alex Grad , jason.wessel@windriver.com, linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" While at it, check kmalloc return value. Signed-off-by: Alex Grad --- arch/powerpc/kernel/kgdb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index 5ca82cd..9e81dd8 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c @@ -159,7 +159,10 @@ static int kgdb_singlestep(struct pt_regs *regs) if (user_mode(regs)) return 0; - backup_current_thread_info = (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL); + backup_current_thread_info = kmalloc(sizeof(struct thread_info), GFP_KERNEL); + if (!backup_current_thread_info) + return -ENOMEM; + /* * On Book E and perhaps other processors, singlestep is handled on * the critical exception stack. This causes current_thread_info()