From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brendan Higgins Subject: Re: [PATCH v12 10/18] kunit: test: add tests for kunit test abort Date: Mon, 12 Aug 2019 22:06:04 -0700 Message-ID: References: <20190812182421.141150-1-brendanhiggins@google.com> <20190812182421.141150-11-brendanhiggins@google.com> <20190813042455.4A04320644@mail.kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20190813042455.4A04320644@mail.kernel.org> Sender: linux-kernel-owner@vger.kernel.org To: Stephen Boyd Cc: Frank Rowand , Greg KH , Josh Poimboeuf , Kees Cook , Kieran Bingham , Luis Chamberlain , Peter Zijlstra , Rob Herring , shuah , Theodore Ts'o , Masahiro Yamada , devicetree , dri-devel , kunit-dev@googlegroups.com, "open list:DOCUMENTATION" , linux-fsdevel@vger.kernel.org, linux-kbuild , Linux Kernel Mailing List , open list:KERNEL SELFTEST FRAMEWORK List-Id: devicetree@vger.kernel.org On Mon, Aug 12, 2019 at 9:24 PM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-08-12 11:24:13) > > + > > +static int kunit_try_catch_test_init(struct kunit *test) > > +{ > > + struct kunit_try_catch_test_context *ctx; > > + > > + ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); > > Can this fail? Should return -ENOMEM in that case? Yes, I should do that. > > + test->priv = ctx; > > + > > + ctx->try_catch = kunit_kmalloc(test, > > + sizeof(*ctx->try_catch), > > + GFP_KERNEL);