Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756796AbcKKUh4 (ORCPT ); Fri, 11 Nov 2016 15:37:56 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:46350 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756146AbcKKUhy (ORCPT ); Fri, 11 Nov 2016 15:37:54 -0500 Subject: Re: [PATCH] Block: mtip32xx: Improvement in code readability when memdup_user() fails. To: Sachin Shukla , Asai Thambi SP , Selvan Mani , "Rajesh Kumar Sambandam" , Vignesh Gunasekaran , Al Viro , , References: <1478855091-26096-1-git-send-email-sachin.s5@samsung.com> CC: , , , From: Jens Axboe Message-ID: <34d324f6-d250-cecf-983d-0f4bcf235855@fb.com> Date: Fri, 11 Nov 2016 13:37:35 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1478855091-26096-1-git-send-email-sachin.s5@samsung.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [66.29.164.166] X-ClientProxiedBy: CO2PR07CA0006.namprd07.prod.outlook.com (10.141.194.144) To BN6PR15MB1185.namprd15.prod.outlook.com (10.172.205.139) X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1185;2:1IsOzHN0JMm8spq04GAlVTENKRcGZXvBcKz7jk3owBk739zlAKlqRgmLYK73WAZ+8FDyorleQXZicnst6/dkj837AZRbFPkdjy2aKrgr3Xngm1LsBv1tji4cu53kIMcwB3WZtNimH8/jz0Q+0qa8HgbFHdzGxUi+MPJ9tMGPOH0=;3:UsG7qxvoYmjeGEf80Kln5PVeqvRy8gLEhgl0ot5Z5YatwymqkcBW1Ca3DEVVcmi6dtXqBSWgVne0+xlDbl6PR+kuZoH6nN895O6qfZtRqAsSfMPaDiLHR5IFvCtgZAgUK+A7Umlto0PmKos5Snm4YGT5o9bmAHJDaGBxKjcvdVg=;25:xbJ4dUQrtV9GMo1kqhkeKNywv6Ab9a2mTJQ3Hyyf8Sd7eS52cFZps3OuvE3yHv/J6Y5xZ2kaCkA67hmUD2mJabWA9JgiTKy6IUoygPeY4vJUykjXyeDZzi088L+spzvyJ27upnAoM9evxIRC3fE1v2xPFg0yfXyHIi/2rgPlBJGldkV5Mb9daP9odDTfafL7Rw4/a1zwawVo8VjUz3mrKKxEL90q15GZ8vO+UXK/r490IXFWMCcBrNSRUjHqAaklO6kBJO9ygMsAFA309kdOLyjPrfGQnWhavxOT4HR7iGls3E0HNfJd6Kt7+ArT32QmKW6EZcsVbXjIECqULgNvnBx/HXcI4hdZmUsgAldFhRZqxUnW1LiUoK6sEeAV5GzUmGJXWj1hZiJE+RhnAwBsrf+TUoSPJVbGqy5EwhtFD1vHVvqPP8e8ycxtfbumXmx8 X-MS-Office365-Filtering-Correlation-Id: b6c44481-c752-477b-0e63-08d40a7296eb X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR15MB1185; X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1185;31:6Mhfz378shK83ykRP9xbZk5DEbS12J0IJaYVigtuNTqWYIzqsf57aeOmKKFZAhibFCgLi8TKhY1iSAwrQIakDAhK/6mMX2aWXOawUXw8TlxA5r/tzeUUXomO8VBP0o+yOeJ45zSEf7jpRIu1dxV3pOfYdrEbNNKaRCjI6TBaCieLWYJzbt1ENQUr8uKtnsnynL6/cXYpoxsUvaOpICSwv5xjoygZwH2qrL5yaMBYbPJ9vipTdyUHGR+U6d7P27OU;20:uOU3v06ewGFuccUPxdLxCgce7XuX8DgCLmqefWrA8ULydxPq/kPUV+EWb6v4h/YZEyQsiACmFmKy7Cd0x0n/fQ7rrMpB1U7+E82H3bsdJr2C7UyJdPd2/axZf9APPhTKsih51YYUV659eaHVO2uDRXP+SA3uWM7XMcbiVyeBKE6AuBZIqhqNz3J7c8w5t9qjI+k/w3XsWrYX6TmRWS2/QPepgiD9j2y0bUj9n9Gb5199LjLkjmvgEmg+AUaSf1oGHzRm9f1kWq7Q8gaZYqQZeUb8zJuVm4z2vBIJ/JASEytAJEuwP+RhLQKOTSN12iWyPS/2GseFfIJ5PRyKoC6GRQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(7411616537696); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);SRVR:BN6PR15MB1185;BCL:0;PCL:0;RULEID:;SRVR:BN6PR15MB1185; X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1185;4:nUROfvV4jOqVzvJuHj6aczXjK4fRRDTcHUnLSMusTufKXIF3MJF41rWvS6XWkD3oUPG3OqzqewMIWcfZpJTm3T/Lt/GLI/15p6o9Y4Z7b48lq3KurSPgbzxWVzsJz+saZek6hd+BpomKMpK5stzeK04ssjlyTG7T08mrTtZS24/slqXaYJFlsugZpC2ColMUFavpkkDqOU+zeDa8C5C9P8KuBj/jazU9pdMLEVPVplv2SXtjILzudXV+z4nBcYpiyJ1Wq1xXAA50Rxtj+UveyHVoLpZfsICiFJV7l8+jMx2ClKdD4lahG5LZctrx4IodlPI2EOdm1xMmtNNylOUD/tvyc3ehK5PBHyShEic0EFxKRpRvaxodjL3m+T9pTcgZq2lJj7udkrYb9xxTxVQmzpAQPKXHI7QUwHLstLV8U7j/WcY6iYwAx4kkiWtqaZ8P X-Forefront-PRVS: 012349AD1C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(189002)(199003)(377454003)(24454002)(68736007)(92566002)(230700001)(5660300001)(83506001)(97736004)(2950100002)(31696002)(6666003)(189998001)(65806001)(5001770100001)(4001350100001)(65956001)(66066001)(47776003)(65826007)(2906002)(229853002)(42186005)(117156001)(50986999)(76176999)(54356999)(33646002)(4326007)(6116002)(3846002)(558084003)(586003)(36756003)(7416002)(81166006)(86362001)(81156014)(8676002)(50466002)(64126003)(77096005)(2201001)(305945005)(7846002)(7736002)(101416001)(31686004)(105586002)(106356001)(23746002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1185;H:[192.168.1.176];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BN6PR15MB1185;23:6DXG70CqDo7JW0rl7UWiegrdA0bw714RPZ2A7?= =?Windows-1252?Q?9bQTnYfB9GrY7cWm/GuwOG+PilMQJiNZ9XNzxpA1g5T7NDTb/qPvHYMm?= =?Windows-1252?Q?mgah95cvploV7lqQoppKj+qvHIPC2KX+PB5YdTJ4/qZKTuGqjyjeMw7m?= =?Windows-1252?Q?gaXpz1QiguX9QyoMmQ1VzTi5FhEf53zr8OtJ4wVvh6J2eT3yKmTURLrg?= =?Windows-1252?Q?19QwqIbt33IcArB6d9RwxtCePld7ADsXirh+9ARbTPO9yuepNlOvGJMZ?= =?Windows-1252?Q?4R0FgM9wBKYWXo0Xv1sIYa1VmAOcYzR9EnFnEH37wXnco39ZhTSdkJRv?= =?Windows-1252?Q?P1Ivvq+jmrOyNFRJ8XFfsyvEYVIKe24jZu8tyK92X6C6vXB29B8keksr?= =?Windows-1252?Q?XSJb65JwlEgK47yBPKkab0XzbM8bNUn+JbB3hRmomUE+Z3ZkDOfp0JHA?= =?Windows-1252?Q?hvQGso1aWA2VqaMJaE5nsPCS09GKcOEbcrYIZmgeEliCxrWRpJTtj+10?= =?Windows-1252?Q?m20iWRFbHayejsdCQjkB+HVwAI3Yep33XyNdSa/Xua5E9GoNtK0EeRFE?= =?Windows-1252?Q?Ag8aXLYBd94uwmA+8QKSFYLAKzG6pvt8bDXCiTbJYkJx7LKauFHZO/pj?= =?Windows-1252?Q?nEHaH4IOZHSN40782odZD/P0iFsUcO2uOZmf6SO8jM7NZnrpE5uoQMMx?= =?Windows-1252?Q?ucWfKlQj8uXHvyE1vkCriqXOuAAKQU2+2Vs9NF+g1faZRNnrBEzPb8JR?= =?Windows-1252?Q?RnvT0KxmqB6NTnh8CL2bvDua09AwhHe3iBrxhPrqaUNTSEbkvw5kZqTw?= =?Windows-1252?Q?CARDgU0ANvV1bJUvB4TlCelF7NCRsRB4M9RdmKQyYkhpoUvn4gT8yAle?= =?Windows-1252?Q?92Dz13b4osDeSxuhvT68kCroiiIWmxjGCZaJHgMVI9kEa5oqZRvjv+8x?= =?Windows-1252?Q?vYIp+Sp3o2GWpre/dWAXT3HsvTYHORtAozeGSF76QIcpk1DByGReM3TM?= =?Windows-1252?Q?cBxuUHoRZHcjcLrlhqaaAYVlJPqCg69LJ26Fm95WwT5tu18AEKCBPChx?= =?Windows-1252?Q?5mfpeYVALMGqXt8I+MBPgSrVklmGqIBHHR8Qu6QhHw9GhYGNCSYkAUi+?= =?Windows-1252?Q?50CjaoFAcM20pJ4qWhoriC+kbf3RQUKRrEqSU2L+bMXTkH2iU0EOSDdm?= =?Windows-1252?Q?jEWIUG1cBkxJBYVI+x9/yOAUM+Q7Aj/dFH92GPI24w3mnFG5uOdrM7aL?= =?Windows-1252?Q?LQNKTDEw/6ATHt4L5GMCLfoDK1hPl4PIhrptbFefGGzxM1WgAPUYkwhk?= =?Windows-1252?Q?vjZTtF55H+Nm4iJaEDLxYqWkGusqHfw1Xzg2S4RCrDrr2QTQM5Q6UkDj?= =?Windows-1252?Q?4ZsV7lyPpLmI1RTyUNOQvKP9ntJJqP6UbTQajqE2y2KxeHRr4Myu3HOQ?= =?Windows-1252?Q?KtTWit9Hdxyk7rqSZcmMCelgfjjffXIzqgaD0qqwg9MU89qWcR88m5GQ?= =?Windows-1252?Q?RH/jJg=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1185;6:YFuuTAbzA1AtB5bSNSLHjNIUwMqk1AwzZWp9VPBH0BeX8K0sa+8g/zNcDfoBsOjoGbnNuQ/IcXNJqu4lcB7ANTEbHgZekn3db+LzR/Cujf299aaBoa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RyBnU= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2016 20:37:42.0722 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1185 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-11_09:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 288 Lines: 10 On 11/11/2016 02:04 AM, Sachin Shukla wrote: > From: "Sachin Shukla" > > There is no need to call kfree() if memdup_user() fails, as no memory > was allocated and the error in the error-valued pointer should be returned. Applied for 4.10, thanks. -- Jens Axboe