Received: by 10.223.185.116 with SMTP id b49csp3208449wrg; Mon, 5 Mar 2018 16:34:40 -0800 (PST) X-Google-Smtp-Source: AG47ELt9R/FySSxTDluEI0X9FDlyg1YXSJvV1OuhRrDyUABbGK+zAt8AAd1GZTKcdsUija4+L1r+ X-Received: by 2002:a17:902:718c:: with SMTP id b12-v6mr6948360pll.121.1520296480685; Mon, 05 Mar 2018 16:34:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520296480; cv=none; d=google.com; s=arc-20160816; b=zx42qo751he4vVJOKs+JvoZ4K6i04mvYbsxgcF+bgL+R05xDc9hP59o2DQfXFrqlmz 7zrat3jr25+Fznyf+clNvvxJW2pDTScUH4JvnEmv+VRT7oUu1n5b4HG0yM8OWTsM5Ncg +IuEYdVz3bCRy39bI2uBLR7bz8ymHx9vSQFBeg6/IMHEDgW2DgfSEkE++pqPVJKBg3bX zqVlt4i1fq9Ykc09svncU6iXseQWsdoxVQ5K4fa0RE5sZzLn6ak75P2EtlGdVRLdaIYq VALUE3zr72kW/caDSu0tAIQ8GUOCdlQuGkbaLzkIM73ImccC6VcX442fQ7WZ6ybJ2BpA nnDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=CoahtpSACNL1iQzZIsxk+OijmxP6/iYmC9GGbrKDcG4=; b=glmczL7Gia2LpO5mfh1+3uLDY+crw4HBctftaPj9Ofz9yWTI5N+50Nhv5VY6SaEItA tj+pTKQw3ppKOYeBWq1lWPFL9ZvBpo9PwDWnxEazQrId6c/2ztVKYfb3Whg9C71ht8P1 5tlCC8LKZuEsm7jTw5zpRMaW7wd89hdTeDpEg0h5P0iMWq6Uq4ttao4f9ZfgoXsSa63j TXwRd73VXs+XHDsK1XuW2Dx+xJEBypbU7my5vy+rKejgTdLfufrNocqWb/qV/XpPpf+U iQ6NotIyUJ1ONuX+zyLQrGk4R+4EY55Jqoni6n+DnBuuJwJuVMhPdJglzvEhn+R7blzx Yl8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=gc/YXOYL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12-v6si10079044pls.270.2018.03.05.16.34.26; Mon, 05 Mar 2018 16:34:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=gc/YXOYL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933120AbeCFA0p (ORCPT + 99 others); Mon, 5 Mar 2018 19:26:45 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:40838 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933335AbeCFA0k (ORCPT ); Mon, 5 Mar 2018 19:26:40 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w260MFFK187652; Tue, 6 Mar 2018 00:26:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=CoahtpSACNL1iQzZIsxk+OijmxP6/iYmC9GGbrKDcG4=; b=gc/YXOYLbQmlj3zL74z02LsWkdX9rGxzvr7WGfiT8M054XQGUZ0ZovpGYxOo3LQoktvk yOE9x4tWnN+aFhFKhE1xQ6Bkay1zxNSjV7Pauio/d7cdU92WuSl+C8WfJoJtit89l1i/ 8CcdUsQkm3+t7cSGHEvJvMxZZbthLMZGFOXsmGMJQM5KGrXVO+ORtnDqAeUe5Vd7S/FV cFObYePLgEauLA5OxRu8QbrRCY5p4yGtcY9v15wa1I2ggx63vBn6AsuYrQyKgQvY5pZz IJy47evLejQh+aOLst0G+djkmFAklWuqDiH0PT3DqfnuwhXW3aIsbtdUn9DuuycqNXLf VA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2ghdxf8jr3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Mar 2018 00:26:26 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w260QPKr025621 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Mar 2018 00:26:25 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w260QP9T025096; Tue, 6 Mar 2018 00:26:25 GMT Received: from localhost.localdomain (/98.216.35.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Mar 2018 16:26:24 -0800 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux-kernel@vger.kernel.org, Alexander.Levin@microsoft.com, dan.j.williams@intel.com, sathyanarayanan.kuppuswamy@intel.com, pankaj.laxminarayan.bharadiya@intel.com, akuster@mvista.com, cminyard@mvista.com, pasha.tatashin@oracle.com, gregkh@linuxfoundation.org, stable@vger.kernel.org Subject: [PATCH 4.1 30/65] kaiser: fix build and FIXME in alloc_ldt_struct() Date: Mon, 5 Mar 2018 19:25:03 -0500 Message-Id: <20180306002538.1761-31-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180306002538.1761-1-pasha.tatashin@oracle.com> References: <20180306002538.1761-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8823 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=762 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803060003 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hugh Dickins Include linux/kaiser.h instead of asm/kaiser.h to build ldt.c without CONFIG_KAISER. kaiser_add_mapping() does already return an error code, so fix the FIXME. Signed-off-by: Hugh Dickins Acked-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 9b94cf97f42ca30fe9b5010900fa6e1d6855a9f6) Signed-off-by: Pavel Tatashin --- arch/x86/kernel/ldt.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index 9c6ebaf0a83b..c388247e0353 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c @@ -48,7 +48,7 @@ static struct ldt_struct *alloc_ldt_struct(int size) { struct ldt_struct *new_ldt; int alloc_size; - int ret = 0; + int ret; if (size > LDT_ENTRIES) return NULL; @@ -76,10 +76,8 @@ static struct ldt_struct *alloc_ldt_struct(int size) return NULL; } - // FIXME: make kaiser_add_mapping() return an error code - // when it fails - kaiser_add_mapping((unsigned long)new_ldt->entries, alloc_size, - __PAGE_KERNEL); + ret = kaiser_add_mapping((unsigned long)new_ldt->entries, alloc_size, + __PAGE_KERNEL); if (ret) { __free_ldt_struct(new_ldt); return NULL; -- 2.16.2